The Finest Hand-Selected Downloads
Individually reviewed & tested
Store News

messagebox 0.1.0

Display messages from batch files

Rating:
(0)
Operating Systems:
Windows 10, Windows 7 (32 bit), Windows 7 (64 bit), Windows 8, Windows Vista, Windows XP
License:
Open Source
Developer:
Danyil Bohdan
Software Cost:
Free
Category
Developer & Programming
Date Updated:
10 September 2016
Downloads To Date:
786
Languages:
English
Download Size:
60.60 KB

Messagebox is a tiny portable tool for displaying messages and questions from batch files or scripts.

The program can be used just to show a warning ("xyz will happen next"), or to ask a question and return the result as an ErrorLevel.

The syntax looks like this:

messagebox message title [type]

The most interesting element is the optional "type", which defines the icon displayed, the buttons used, and which button is the default.

To set it up, you would find the settings you need and add up those values.

set MB_ABORTRETRYIGNORE=2
set MB_CANCELTRYCONTINUE=6
set MB_OK=0
set MB_OKCANCEL=1
set MB_RETRYCANCEL=5
set MB_YESNO=4
set MB_YESNOCANCEL=3

rem Icon.
set MB_ICONEXCLAMATION=48
set MB_ICONWARNING=48
set MB_ICONINFORMATION=64
set MB_ICONASTERISK=64
set MB_ICONQUESTION=32
set MB_ICONSTOP=16
set MB_ICONERROR=16
set MB_ICONHAND=16

rem Default button.
set MB_DEFBUTTON1=0
set MB_DEFBUTTON2=256
set MB_DEFBUTTON3=512
set MB_DEFBUTTON4=768

rem Other options.
set MB_SETFOREGROUND=65536

rem Result ERRORLEVELs.
set IDOK=1
set IDCANCEL=2
set IDRETRY=4
set IDABORT=3
set IDIGNORE=5
set IDYES=6
set IDNO=7
set IDTRYAGAIN=10
set IDCONTINUE=11

For example, using Retry and Cancel buttons gives us a value of 5; setting Retry as the default is a value of 4; an exclamation mark icon is 48. That's a total of 57, and we'd use it in a line like this:

messagebox "We've failed to do something important", "Horrible Error", 57

Checking ErrorLevel in the batch file would then give us 4 if the user selected Retry, 2 for Cancel.

Verdict:

There are plenty of tools around to display messages from scripts, but Messagebox has several advantages: it has no dependencies, runs on anything from Windows NT 4.0 up, is free for all purposes, and gives you the power to use whatever combination of (standard) buttons and icons you need.

Your Comments & Opinion

Related Downloads Other Downloads From This Category

The ultimate command line toolkit?

Open Source

A Chrome extension for chatting, video calling and more

Freeware

Send and receive free phone calls and text messages from your iPhone

Freeware
44,690,769
Downloads
Secure & Tested Software
6,478
Reviews
Instant Download 24/7
314,663
Members
10+ Years of Service