Running Scripts Using Wscript.Exe

Using Wscript.exe, you can run scripts under Windows in three ways:

If you double-click a script file whose extension has not yet been associated with Wscript.exe, an Open With dialog box displays, prompting you to select the program with which to open the file. After selecting Wscript, if you select the Always use this program to open this type of file check box, Wscript is registered as the default application for all files having the same extension as the one you double-clicked. For example, if you select this check box when you run Chart.vbs, Wscript.exe becomes the default application for all files having the .vbs extension.

Wscript.exe has a properties page associated with it that provides the following options:


Property

Function
CSCRIPT equivalent
Stop script after nn seconds. Specifies a maximum number of seconds that a script can run (the default is no limit). //T:nn
Display logo when script runs in a command console. Display a banner before running the script. (This is the default. The opposite is //nologo.) //logo or
//nologo

By using the Wscript.exe Properties page, you can set global scripting options for all scripts that Wscript runs on the local computer. It is also possible to set options for individual scripts, using a .wsh file, as described in the next section.