In some cases, even a single line entered by hand at the PowerShell
prompt can do more than a complex batch file or WSH script. But since
PowerShell is not installed by default in Vista, you can??™t ever assume it??™s
there, thus making it more useful as a personal tool than as a platform
for scripts to distribute to other PCs.
Which scripting platform you choose should depend on your comfort level
and familiarity with the language, as well as the task.
514 | Chapter 9: Scripting and Automation
Windows Script Host
The Windows Script Host is the engine responsible for running scripts.
Rather than a tangible, interactive application like the Command Prompt or
Windows PowerShell (both discussed in more detail later in this chapter),
WSH is simply an extensible collection of support files. In theory, WSH is
language-independent, meaning that it can be extended to support any modern
scripting language, such as Perl and Python. Of course, you can install
and run Perl on your PC and then run Perl scripts completely independently
of WSH, but the concept of WSH integration means that your Perl scripts
would have access to all the WSH objects and services described later in this
chapter. Regardless, most WSH scripts end up being written in VBScript.
VBScript is based on another Microsoft programming language, Visual Basic
(VB), which, in turn, is loosely based on Beginner??™s All-purpose Symbolic
Instruction Code (BASIC). If you??™re at all familiar with BASIC, taught in
grade school since the 70s, the fundamentals of VBScript won??™t be much of a
challenge.
Pages:
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715