Scripting Home > > WScript Methods

Popup Method

Description

The Popup method is used to display a dialog box to a user and wait a button to be pressed, or optionally, a timeout to occur.

object.Popup (Message [, TimeOut][, Title] [, Format])

The return value will depend on which button was clicked as seen in [id=53#results]this table[/id].

Parameters
The Message parameter is a string that specifies the text to display in the dialog box.

The optional TimeOut parameter specifies the number of seconds to wait before automatically closing the box and returning a value of "-1".

The optional Title parameter is a string that specifies the title of the dialog box.

The optional Format parameter is the sum of values specifying the number and type of buttons to display, the icon to use and the default button. See [id=53]these tables[/id] for the available options.

Example

'VBScript Example
set WshShell = CreateObject("WScript.Shell")

Result = WshShell.Popup("This is a popup box!", 10, "Title", 65)