windowsbatch-filecommand-linemessagebox

Show a popup/message box from a Windows batch file


Is there a way to display a message box from a batch file (similar to how xmessage can be used from bash-scripts in Linux)?


Solution

  • I would make a very simple VBScript file and call it using CScript to parse the command line parameters.

    Something like the following saved in MessageBox.vbs:

    Set objArgs = WScript.Arguments
    messageText = objArgs(0)
    MsgBox messageText
    

    Which you would call like:

    cscript MessageBox.vbs "This will be shown in a popup."
    

    MsgBox reference if you are interested in going this route.