The information in this article applies to:
SUMMARYWindows Script Host (WSH) enables scripts to be run directly in Windows 2000 by double-clicking a script file or by typing the name of a script file at a command prompt. Like Microsoft Internet Explorer, WSH serves as a controller of ActiveX scripting engines. WSH has very low memory requirements and is ideal for both interactive and non-interactive scripting needs (such as logon scripting and administrative scripting). MORE INFORMATION
WSH supports scripts written in Microsoft Visual Basic Scripting Edition (VBScript) or JavaScript. When you start a script, the scripting host reads and passes the specified script file contents to the registered script engine. The scripting engine uses file extensions (.vbs for VBScript; .js for JavaScript) to identify the script instead of using the SCRIPT tag (used in HTML). Because of this, the script writer does not have to be familiar with the exact programmatic ID (ProgID) of various script engines. The script host itself maintains a mapping of script extensions to ProgIDs and uses the Windows association model to start the appropriate engine for a given script.
To Run Scripts Using the Windows-Based Script Host (Wscript.exe)
You can also set properties for an individual script by right-clicking a script file in My Computer or Windows Explorer, clicking Properties, and then clicking the Script tab. To Set Properties for Individual Scripts
A .wsh file is a text file that uses a format similar to that of .ini files. A .wsh file contains a [ScriptFile] section, which identifies the script file with which the .wsh file is associated, and an [Options] section, which corresponds to the settings you selected on the Script tab. A .wsh file is analogous to the .pif files used to run earlier 16-bit Windows-based and MS-DOS-based programs. It can be treated as if it were an executable or batch file. For example, if you have a script named Myscript.vbs for which you have created a .wsh file named Myscript.wsh, you can run Myscript.vbs with the options recorded in Myscript.wsh by double-clicking Myscript.wsh in Windows Explorer, or by passing Myscript.wsh as a script argument to Cscript.exe or Wscript.exe at a command prompt. For additional information about WSH, please visit the following Microsoft Web site: msdn.microsoft.com/scripting/default.htm?/scripting/windowshost/ Additional query words:
Keywords : kbtool |
Last Reviewed: December 30, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |