https://github.com/dbohdan/messagebox
Display message boxes from Windows batch files and command line programs
https://github.com/dbohdan/messagebox
batch batch-file cli dialog gui windows
Last synced: 11 days ago
JSON representation
Display message boxes from Windows batch files and command line programs
- Host: GitHub
- URL: https://github.com/dbohdan/messagebox
- Owner: dbohdan
- License: mit
- Created: 2016-08-22T14:41:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-01-19T19:59:37.000Z (over 5 years ago)
- Last Synced: 2025-02-16T04:21:21.945Z (2 months ago)
- Topics: batch, batch-file, cli, dialog, gui, windows
- Language: Shell
- Size: 22.5 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Batch MessageBox
[](https://ci.appveyor.com/project/dbohdan/messagebox)
This is a tiny hack to display message boxes from Windows batch files and
command line programs. There are many like it but I didn't find any that was
open source, non-copyleft and had no external dependencies like the .NET
Framework.Another goal of this project is to create a framework that makes building
a simple Windows program with MinGW and running the tests for it surprisingly
easy and pleasant. Never mind that; use MSYS2. (The old build scripts are
preserved in the branch
[mingw](https://github.com/dbohdan/messagebox/tree/mingw).)## Binary downloads
You can download a prebuilt .exe file from the
[Releases](https://github.com/dbohdan/messagebox/releases) page on GitHub.## Use example
```batch
@echo off
chcp 65001 > nul
set MB_YESNO=4
set MB_ICONQUESTION=32
set MB_ICONINFORMATION=64
set IDYES=6
set /a type=%MB_YESNO% + %MB_ICONQUESTION%
messagebox "Shall we play a game?" "Helpful Computer" %type%
if "%ERRORLEVEL%"=="%IDYES%" messagebox "What a cliché answer!" "Helpful Computer" %MB_ICONINFORMATION%
```See [demo.cmd](./demo.cmd) for more.
## Build requirements
* [MSYS2](https://msys2.github.io/);
* Optionally, [sendkey](https://web.archive.org/web/20190305143035/http://www.f2ko.de/en/cmd.php) to run the tests.Install MSYS2 then start the 32-bit MinGW shell (with `C:\msys32\mingw32.exe` or
`C:\msys64\mingw32.exe` in an up-to-date MSYS2 installation) and run
the following commands:```sh
pacman --sync --noconfirm git make mingw-w64-i686-gcc wget
git clone http://github.com/dbohdan/messagebox
cd messagebox
make
make sendkey.exe # Download sendkey.exe and verify its checksum.
make test
```## License
MIT.