This Appendix gives details about the Windows Script Host objects. Further details and examples can also be found in Chapter 12.
Windows Script Host has 14 objects outlined.
This object provides access to most of the objects, methods , and properties contained in the WSH object model.
This object gives the programmer access to the entire collection of command-line parameters in the order in which they were originally entered.
This object exposes the method CreateScript() that creates a remote script process.
This object gives the programmer access to the collection of Microsoft Windows system environment variables .
This object provides access to the named command-line script arguments contained within the WshArguments object.
This object gives the programmer access to the shared resources on the network to which the host computer is connected.
This object provides access to the remote script process.
This object is used to expose the error information available when a remote script terminatesas a result of a script error.
This object provides status and error information about a script.
This object is used to give the programmer access to the native Windows shell functionality.
This object allows the programmer to create shortcuts.
This object is used to access Windows Special Folders.
This object provides access to unnamed command-line script arguments within the WshArguments object.
This allows the programmer to create a shortcut to an Internet resource.
The root of the WSH object model is the WScript object. This object provides properties and methods that give the developer access to a variety of information, such as:
The WScript object has 11 properties:
The WScript object has seven methods:
This object gives the programmer access to the entire collection of command-line parameters.
The WshArguments object has four properties:
The WshArguments object has two methods:
This object is used to expose the method CreateScript() that creates a remote script process.
The WshController object has no properties.
The WshController object has one method:
This object provides access to the collection of Windows environment variables .
The WshEnvironment object has two properties.
The WshEnvironment object has two methods:
This object is used to provide access to named arguments from the command line.
The WshNamed object has two properties:
The WshNamed object has two methods:
The WshNetwork object provides access to the shared resources on the network to which the computer is connected.
The WshNetwork object has three properties:
The WshNetwork object has eight methods:
This object is used to provide access to the remote script process.
The WshRemote object has two properties:
The WshRemote object has two methods:
This object provides access to the error information available when a remote script terminates because of a script error.
The WshRemoteError object has six properties:
The WshRemoteError object has one method:
The WshScriptExec object provides status information about a script run with Exec when used in conjunction with the StdIn , StdOut , and StdErr streams.
The WshScriptExec object has four properties:
The WshScriptExec object has one method:
Windows Script Host provides a convenient way to gain access to system environment variables , create shortcuts, access Windows special folders such as the Windows Desktop, and add or remove entries from the registry. It is also possible to create more customized dialogs for user interaction by using features of the Shell object.
The WshShell object has three properties:
The WshShortcut object allows you to create shortcuts using script.
The WshShortcut object has eight properties:
The WshShortcut object has one method:
The WshSpecialFolders object provides access to the collection of Windows special folders. The following special folders are available:
The WshSpecialFolders object has one property:
The WshSpecialFolders object has one method:
The WshUnnamed object provides access to the unnamed arguments from the command line. The WshUnnamed object is a read-only collection that is returned by the Unnamed property of the WshArguments object. All individual argument values are retrieved from this collection using zero-based indexes.
There are three ways to access sets of command-line arguments:
The WshUnnamed object has two properties:
The WshUnnamed object has one method:
The WshUrlShortcut object allows you to create shortcuts to Internet resource using script. The WshUrlShortcut object is a child object of the WshShell object. You must use the WshShell method CreateShortcut to create a WshUrlShortcut object.
The WshUrlShortcut object has two properties:
The WshUrlShortcut object has one method:
Introduction