exe) directly.
Build a VBScript Script | 515
Scripting and
Automation
There are actually two WSH script interpreters (engines)
included with Vista. WScript.exe is a native Windows interpreter
and is used in most cases. CScript.exe is a console
interpreter, and is used when you want the script output to
be sent to the console (Command Prompt). You can use
CScript.exe at any time by right-clicking a script file and
selecting Open with Command Prompt.
When the Scripting Host runs the script, the commands are executed in
order, one by one. You can leave a Notepad window open to make changes
and additions while you test the script; big screens are especially handy for
this sort of thing.
You can quickly open an existing script file for editing by right-clicking and
selecting Edit. This will, by default, open Notepad, although you might
want to associate the Edit action for .vbs files with a more powerful text editor
(see ???File Type Associations??? in Chapter 3).
The process of putting a script together essentially involves typing commands
and then running the scripts to test them. Following are the background
concepts necessary to complete many tasks with scripts:
??? Using variables to store and manipulate information
??? Asking for and displaying information with the InputBox and MsgBox
commands
??? Creating interactive scripts with conditional statements
??? Using loops to repeat a series of commands
??? Making building blocks with subroutines and functions
??? Extending scripts with object references
Use Variables to Store and Manipulate Information
The use of variables is essential when some interaction is required by a
script.
Pages:
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717