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

Batch Files

While Windows Script Host is the most powerful tool for creating your own helpful programs, it's also useful to know how to use the batch file language. Batch files let you take advantage of the hundreds of command-line programs supplied with Windows. While the batch file language is less powerful than VBScript, it has variables, primitive functions, and rudimentary flow-of-control commands, so it does qualify as a programming language.

A batch file, at the very simplest level, is just a list of command-prompt commands typed into a file whose extension is .BAT or .CMD. When you enter the name of a batch file at the command prompt, Windows looks for a file with this name in the current directory and in the folders of the search PATH that I discussed earlier under “Making Scripts Available.” Then, it treats each of the lines in the batch file as a command, and runs it as if you'd typed the commands by hand. At this simplest level, then, a batch file can be a big help if you find yourself typing the same commands over and over.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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