Command Prompt for Windows

Command MSGBOX


Display a message in a pop-up window. The button pressed to close the window is stored in an environment variable called MSGBOX.


MSGBOX "title" "text" [flags]
titleA string which specifies the window caption.
textA string containing a sequence of characters which specifies the message to display
flagsA number which specifies the following attributes :-
  • Button :-

    0OK button (default).
    1OK and Cancel buttons.
    2Abort, Retry, and Ignore buttons.
    3Yes, No, and Cancel buttons.
    4Yes and No buttons.
    5Retry and Cancel buttons.
  • Icons :-

    0No icon (default).
    16Stop icon.
    32Question icon.
    48Attention icon.
    64Information icon.
  • Button action :-

    0First button is the default.
    256Second button is the default.
    512Third button is the default.
    To specify more then one attribute simply add the values together


The following icons are displayed under Windows Xp :-


To include a new line character in parameter text use a tilda character (ie. ' ~ ').

Example on using MSGBOX.

Also see command EDITBOX and DISPBOX.