Microsoft® Windows® Script Host Customizing Script Settings |
WSH Tutorial Previous Next |
You can record specific settings for each of your individual scripts by means of a Windows Script Host control (.wsh) file. The .wsh file is a text document in which you can customize execution of one or more of your scripts.You can create multiple .wsh files for a single script, which enables you to tailor the way the script runs to the needs of specific groups or even individuals within an organization. Thus a single logon script, invoked by two different .wsh files containing different settings and parameters, can be made to serve two very different groups.
The .wsh file is analogous to the PIF file used to run older 16-bit applications. It is created automatically when you set the properties for a supported script file. You can treat it as if it were an executable file or batch file.
For example, suppose you have a script named Myscript.vbs for which you have created a .wsh file named Myscript.wsh. To run Myscript.vbs with the options recorded in Myscript.wsh, you can either double-click Myscript.wsh in Windows Explorer, or pass Myscript.wsh as a script argument to CScript.exe or WScript.exe. You could do the latter by entering the following command at the command prompt:
For details, see Setting Script Properties.c:\>cscript Myscript.wsh