Site hosted by Angelfire.com: Build your free website today!
Chapter 40: Automating Tasks with the Windows Script Host

PreviousChapterContentsGlossaryNext

Running Scripts from the DOS Command Line

Despite the replacement of DOS with the DOS Virtual Machine (described in Chapter 39), you can still run scripts from the DOS command line by using the Cscript program. The Cscript.exe file is part of WSH and is installed in the C:\Windows\System32 folder.

To run a script using Cscript, follow these steps:

  1. Open a Command Prompt window by choosing Start | All Programs | Accessories | Command Prompt. You see the DOS prompt, which is usually C:\Documents And Settings\username&ra;. You can also open the window by choosing Start | Run, typing cmd in the Open box, and pressing ENTER.
  2. Type cscript followed by a space and the full pathname (file address) of the script you want to run. You can also type the command-line options listed in Table 40-1.
  3. Press ENTER. The script runs.

PreviousChapterContentsGlossaryNext