• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Running Scripts

In the example in the previous section, I mentioned that you can usually run a script by double-clicking its file in Windows Explorer. That's one way of doing it, but there are several other ways to start scripts. In this section, I'll go over each of them. First, though, we need to discuss the two environments available in which to run scripts.

Wscript and Cscript

Windows Script Host comes in two flavors: a windowed version named Wscript, and a command-line version named Cscript. Either version can run any script. The difference between the two is that the windowed version (Wscript) displays text output messages with a pop-up dialog box like the one shown in Figure 1.3, whereas the command-line version (Cscript) displays text through the normal “standard output” mechanism common to command-line programs. Cscript is best suited for scripts that produce lots of output, such as directory listings, and for scripts whose output you'd like to capture into a file.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint