VBScript is used primarily in this chapter because it??™s easy to
learn; it supports easy access to the features we need, like Registry access
and file operations; and its cousin, VB, is one of the most widely used programming
environments in the world.
So, where does WSH end and the VBScript language begin? From the point
of view of the person running the script, WSH starts when you double-click
a script file, at which point it automatically chooses an appropriate language
interpreter based on the script filename extension. From the point of
view of the developer, WSH provides special functionality to all languages
through the use of objects (see ???Object References,??? later in this chapter);
that way, each WSH-supported language needn??™t bother providing functionality
for advanced functions, such as Registry access and filesystem operations.
Build a VBScript Script
A script is simply a list of commands placed one after another and stored in
a text file. Script commands are like building blocks: the more commands
and programming techniques you learn, the broader your palette will be for
making useful scripts. Some of the simpler building blocks will be used in
this section of the chapter to illustrate the way scripts are built. For more
advanced topics, skip ahead to subsequent sections of this chapter.
To run a script, just double-click on the script file icon; you??™ll probably
never need to run the Scripting Host program (wscript.
Pages:
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716