Displays a message in a dialog box and pauses until the user clicks a button.
String expression displayed as the message in the dialog box.
The maximum length of prompt is approximately 1024 characters, depending
on the width of the characters used. The syntax for MsgBox or message box is simple.
You type the msgbox and double quoted string or variable. If more than one variables or strings are passed to the message
box, you must use concatenation sign or it will not accept the values. Message box is able to display any type of values.
For example: msgbox"Hello there visitor" This message box display Hello there visitor.
dim name name="Mohamed A" msgbox "To the honor of: " &name This dialog box
displays To the honor of Mohamed A. To view how message box look like, click the button bellow.
When you click on the button above, the dialog box appears has only OK button. This is the only default button but
you can modify and display any button or buttons you wish to display. For example: msgbox"Do you want continue",vbYesNoCancel
Display Yes, No, and Cancel buttons with a question mark.
msgbox"Wrong file name",vbRetryCancel Display Retry and Cancel.
Number values can be
used to display buttons on the dialog box. For example: The following example is similar to
msgbox "Do you want to continue",vbYesNo.
msgbox"Do you want to continue",4
. Following are list of button arguments available in vbscript.