Windows Script Host enables you to run scripts from Windows. WScript.exe provides a Windows-based dialog box for setting script properties. Using WScript.exe, you can run scripts under Windows in the following ways. Whether you use WScript or CScript, you still run the scripts in the same manner. The difference is only in the output WScript generates windowed output, while CScript sends its output to the command window in which it was started.
On initial installation, the default host is WScript. To change it to CScript, type the following at the command line:
Or, to change it from Cscript to Wscript:
To run a script using the default engine:
Note On Windows NT and Windows 2000 only, simply enter the script name on a command line.
To run a script using a particular engine:
To run scripts using WScript.exe
WScriptfollowed by the full name and path of the script you want to run.
If you double-click a script file whose extension has not yet been associated with WScript.exe, the Open With dialog box appears and asks which program to use to open the file. Choose WScript and check Always use this program to open this file to register WScript as the default application for all files with that extension.
The WScript.exe and CScript.exe properties dialog box provides the following options:
|Stop script after specified number of seconds.||Specifies the maximum number of seconds that a script can run. The default is no limit.
CScript.exe equivalent: //T:nn
|Display logo when script is executed in command console.||Displays a banner before running the script. This is the default. The opposite is //
CScript.exe equivalent: //logo or //nologo
Using the WScript.exe Properties dialog box, you can set global scripting options for all scripts that WScript runs on the local machine. You can also set options for individual scripts using a .wsf file.