msgbox

display a message box and get response from user 

Command


SYNOPSIS

msgbox [-fq] [-W winstation] [-D dtop] [-b button] [-d defbutton] [-i icon] Title Message


DESCRIPTION

msgbox displays a message box. The message box can include predefined icons, buttons, and text, and takes a response from the user. msgbox can be run from a shell script to inform users of certain conditions or necessary actions, and to get feedback from the user on the desired action.

Note:

To include a newline in the specified Message, you should use the echo utility to generate the text. For example, msgbox Sample_Title "$(echo 'Line 1\nLine 2')" displays Line 1 on one line and Line 2 on the next.

Options

-bbutton 

includes a button or buttons with the message box. These buttons can be one of the following:

abortretryignore
ok	
okcancel
retrycancel
yesno
yesnocancel

Note:

Button options that contain more than one word appear on screen as multiple buttons. For example, the abortretryignore option would appear on screen as three separate buttons: abort, retry, and ignore.

-D dtop 

Specifies dtop as the desktop where the message box is displayed.

-d defbutton 

defines a default button. This option defines which button appears selected when the message box first appears. defbutton must be one of 1, 2, or 3.

-f 

positions the message box in the foreground of the window.

-i icon 

includes an icon with the message box. icon must be one of the following:

asterisk
exclamation
hand
information
question
stop

On 8.1/2012R2/10/2016/2019/11/2022 asterisk and information display the same icon, and hand and stop display the same icon.

-q 

runs in quiet mode. Normally a response is printed to standard output and an exit code is returned; -q suppresses the print-out to standard output.

-W winstation 

Specifies winstation as the windowstation where the message box is displayed. When you specify this option, you must also specify the -D option to specify a desktop on that windowstation. The -W option must precede the corresponding -D option.


DIAGNOSTICS

Exit values are printed to standard output unless otherwise specified by use of the -q option. Possible exit status values are:

0 

Failed.

1 

Successful.

2 

Cancel.

3 

Abort.

4 

Retry.

5 

Ignore.

6 

Yes.

7 

No.


PORTABILITY

Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.


AVAILABILITY

PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
filebox

Using the MKS KornShell


PTC MKS Toolkit 10.4 Documentation Build 39.