.WSH
The Windows Script Host control file (.wsh
) is a text document in which you can customize the execution of one or more of your scripts. It is created automatically when you set the properties for a supported script file.
The following example illustrates a typical .wsh
file:
[ScriptFile]
Path=C:\WINNT\Samples\WSH\showprop.vbs
[Options]
Timeout=0
DisplayLogo=1
BatchMode=0
The path information in the [ScriptFile]
section identifies the script file that is associated with the .wsh
file. The keys in the [Options]
section correspond to settings in the Script tab within the Properties dialog box.
Note:
- You must have the original script file present when executing the
.wsh
file. If the.wsh
file fails to run the script, check thePath=
information in the.wsh
file to ensure that it points to the script you are attempting to run. - When you double-click a
.wsh
file or run it from the command line,CScript.exe
orWScript.exe
reads the.wsh
file to determine the specific settings that should be used to execute the script.CScript
/WScript
executes the original script, passing in the properties that are defined within the.wsh
file. - It's not possible to specify script parameters with the
.wsh
file. You must run the script (either the script file or the.wsh
file) from a command prompt to add the parameters.