
WSH Objects and Associated Tasks
The following table is a list of the WSH objects and the typical tasks associated with them.
Object
|
What you can do with this object
|
|---|
Wscript |
Set and retrieve command line arguments
Determine the name of the script file
Determine the host file name (wscript.exe or cscript.exe)
Determine the host version information
Create, connect to, and disconnect from COM objects
Sink events
Stop a script's execution programmatically
Output information to the default output device (for example, a dialog box or the command line)
|
WshArguments |
Access the entire set of command-line arguments
|
WshNamed |
Access the set of named command-line arguments
|
WshUnnamed |
Access the set of unnamed command-line arguments
|
WshNetwork |
Connect to and disconnect from network shares and network printers
Map and unmap network shares
Access information about the currently logged-on user
|
WshController |
Create a remote script process using the Controller method CreateScript()
|
WshRemote | |
WshRemote Error |
Access the error information available when a remote script (a WshRemote object) terminates as a result of a script error
|
WshShell |
Run a program locally
Manipulate the contents of the registry
Create a shortcut
Access a system folder
Manipulate environment variables (such as WINDIR, PATH, or PROMPT)
|
WshShortcut |
Programmatically create a shortcut
|
WshSpecialfolders |
Access any of the Windows Special Folders
|
WshURLShortcut |
Programmatically create a shortcut to an Internet resource
|
WshEnvironment |
Access any of the environment variables (such as WINDIR, PATH, or PROMPT)
|
WshScriptExec |
Determine status and error information about a script run with Exec()
Access the StdIn, StdOut, and StdErr channels
|
In addition to the object interfaces provided by Windows Script Host, administrators can use any ActiveX control that exposes automation interfaces to perform various tasks on the Windows platform. For example, administrators can write scripts to manage the Windows Active Directory Service Interface (ADSI).