Skip to Main Content
VBScript in a Nutshell, 2nd Edition
book

VBScript in a Nutshell, 2nd Edition

by Paul Lomax, Matt Childs, Ron Petrusha
March 2003
Intermediate to advanced content levelIntermediate to advanced
512 pages
14h 30m
English
O'Reilly Media, Inc.
Content preview from VBScript in a Nutshell, 2nd Edition

Chapter 7. Windows Script Host 5.6

Windows Script Host (WSH) is designed to eliminate one of the major limitations of theWin32 platform: it has no real batch or macro language that allows common processes (such as creating shortcuts, writing to and reading from the registry, or getting information on the filesystem) to be automated. Windows’ predecessor, the character-based DOS operating system, for instance, included the DOS batch language. And Windows 3.0 included the idiosyncratic and unsuccessful Recorder, which allowed the user to “record” keystrokes and mouse clicks and later repeat them.

When you execute a WSH script, WSH uses WScript.exe as the runtime engine for scripts that run within the Windows environment and CScript.exe as the runtime engine for scripts that execute within a Command Prompt window. WSH is language-independent; it can be used with any language with a Windows Script-compatible script engine. The language most commonly used to write WSH scripts, however, is VBScript.

Why Use WSH?

WSH exposes a relatively small but very significant portion of the functionality of the 32-bit Windows family of operating systems. In addition, WSH allows you to tap into other object models (such as the FileSystemObject object model provided by the Scripting Runtime library) that allow you to access additional features of either the operating system or individual applications.

The advantage of any script is that it allows repetitive tasks—including complex ones that require multiple ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

VBScript in a Nutshell

VBScript in a Nutshell

Matt Childs, Paul Lomax, Ron Petrusha
Microsoft® PowerShell, VBScript and JScript® Bible

Microsoft® PowerShell, VBScript and JScript® Bible

William R. Stanek, James O'Neill, Jeffrey Rosen

Publisher Resources

ISBN: 0596004885Errata Page