Skip navigation

JSI Tip 3443. MSGBOX freeware.


MSGBOX freeware allows you to issue a prompt and test the response in a batch job.

When you open a CMD prompt and type: msgbox /?, the following is displayed:

MSGBOX release 1.1  - Prompt for an answer and set errorlevel
Copyright 1995-1998 by David G. Thomas.

Usage: MSGBOX flags "title" prompt_string ...

        /?      Help (this screen)

        /BARI   Buttons: Abort/Retry/Ignore
        /BO     Button:  OK
        /BOC    Buttons: OK/CANCEL
        /BRC    Buttons: Retry/CANCEL
        /BYN    Buttons: Yes/No
        /BYNC   Buttons: Yes/No/CANCEL

        /Dx     Default is button #x (1, 2 or 3)
        /F1     Send Console window to the foreground before input
        /F2     Send Console window to the foreground after input
        /H      Hide the console window during the prompt

        /I!     Icon Exclamation
        /II     Icon Information
        /IQ     Icon Question
        /IS     Icon Stop

        /MA     Application Modal
        /MS     System Modal (stays on top)
        /MT     Task Modal

        /Tn     Time out after n seconds

        The rest of the line will be the prompt/message string.
        If quoted then each quoted string will be on a separate line.

Errorlevels returned:
        1 = OK
        2 = Yes
        3 = Retry
        4 = Ignore
        5 = No
        6 = Cancel
        7 = Abort
        8 = Time Out

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.