WSH Books, Websites etc

An A-Z Index of WSH commands

Command syntax assumes you have WSH version 5.6 or greater

Arguments, display - WshArguments.Item
Arguments, count   - WshArguments.Count
Arguments, length  - WshArguments.length

Command, run command     - WshShell.Run
Command, execute command - WshShell.Exec
Command, How to install and run a WSH script  - cscript / wscript
Current Directory        - WshShell.CurrentDirectory

Echo           - Wscript.Echo
Echo text      - .StOut.Write
Echo, popup    - WshShell.Popup
Environment, read env variables   - WshShell.Environment
Environment, expand env variables - WshShell.ExpandEnvironmentStrings
Environment, delete env variables - WshShell.WshEnvironment.Remove

Environment, echo ComputerName  - WshNetwork.ComputerName
Environment, echo UserName      - WshNetwork.UserName
Environment, echo user's domain - WshNetwork.UserDomain

Object, create     - Wscript.CreateObject
Object, get        - Wscript.GetObject
Object, disconnect - Wscript.DisconnectObject

NET, net use drive       -  WshNetwork.MapNetworkDrive
NET, list drive mappings -  WshNetwork.EnumNetworkDrives
NET, remove drive map    -  WshNetwork.RemoveNetworkDrive

Path of wscript.exe          - Wscript.Name
Pathname of wscript.exe      - Wscript.FullName
Pathname of script being run - Wscript.ScriptFullName
Printer, add printer         - WshNetwork.AddPrinterConnection
Printer, add Network printer - WshNetwork.AddWindowsPrinterConnection
Printer, list printers       - WshNetwork.EnumPrinterConnections
Printer, set default printer - WshNetwork.SetDefaultPrinter
Printer, remove printer      - WshNetwork.RemovePrinterConnection 

Quit    - Wscript.Quit

Registry, delete - WshShell.RegDelete
Registry, read   - WshShell.RegRead
Registry, write  - WshShell.RegWrite

Shortcut,create - WshShell.CreateShortcut
Special Folders,desktop,start menu etc - WshShell.SpecialFolders

text input          - .StdOut.ReadLine
text output         - .StOut.Write
Version of wscript  - Wscript.Version

SYNTAX

VB Script Variables, Functions, Operators, Conditional and
looping Statements plus some basic naming conventions.

An example Logon Script(.ZIP) for both WSH and Batch Commands

Other sources of help...



Simon Sheppard
SS64.com