What is WSH (Windows Script Host)?
This section describes WSH (Windows Script Host) and its features. WSH is a Windows system administration tool to run VBScript code to common administrative tasks.
WSH (Windows Script Host) is a language-independent scripting host
for Windows Script compatible scripting engines like VBScript engine and JScript engine.
WSH brings simple, powerful, and flexible scripting to the Windows 32-bit platform,
allowing you to run scripts from both the Windows desktop and the command prompt.
Windows Script Host is ideal for non-interactive scripting needs, such as logon scripting,
administrative scripting, and machine automation.
WSH, installed as part of Windows systems, offers the following features:
- There are two hosts provided in WSH: CScript.exe and WScript.exe.
- CScript.exe host running scripts with a command window as console
for standard input and output.
- WScript.exe host running scripts without any command window.
Standard input and output are not available in this case.
- Several runtime objects are provided for administrative tasks
like managing files and folders, mapping network drives, managing environment
variables, and modifying registry keys.
- Different types of script files are supported: *.vbs (VBScript file),
*.wsf (Windows Script File).
- A .vbs file, or VBScript file, contains only VBScript statements.
- A .wsf file, Windows Script File, contains scripting code in an XML file format.
Versions of WSH provided on Windows systems:
WSH 5.812 Windows 10
WSH 5.8 Windows 8
WSH 5.8 Windows 7
WSH 5.7 Windows Vista
WSH 5.6 Windows XP
Table of Contents
About This Book
Introduction of VBScript - Visual Basic Scripting Edition
Variant Data Type, Subtypes, and Literals
Numeric Comparison Operations and Logical Operations
String Operations - Concatenation and Comparison
Variable Declaration and Assignment Statement
Expression and Order of Operation Precedence
Statement Syntax and Statement Types
Array Data Type and Related Statements
Array References and Array Assignment Statements
Conditional Statements - "If ... Then" and "Select Case"
Loop Statements - "For", "While", and "Do"
"Function" and "Sub" Procedures
Inspecting Variables Received in Procedures
Error Handling Flag and the "Err" Object
Regular Expression Pattern Match and Replacement
scrrun.dll - Scripting Runtime DLL Library
Creating Your Own Classes
IE Web Browser Supporting VBScript
IIS ASP Server Supporting VBScript
►WSH (Windows Script Host)
►What is WSH (Windows Script Host)?
"csript.exe/wscript.exe" Command Version and Options
Running VBScript Code Files
"WScript" Runtime Object Hierarchy
"oShell.Exec(cmd)" - Running System Command with a Script
WSF - Windows Script File XML Format
Full Version in PDF/EPUB