• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

10. The Command Prompt > 10.2. Batch Files: The Other Way to Do It

Batch Files: The Other Way to Do It

When it comes to quick-and-dirty scripting, it’s hard to beat DOS batch files. Batch files, similar to WSH scripts (discussed in Chapter 9), are plain-text files with the .bat filename extension. However, rather than relying on a complex, unfamiliar scripting language, batch files simply consist of one or more DOS commands, typed one after another.

One of the problems with Windows-based scripting (see Chapter 9) is that it tries to control a graphical environment with a command-based language. Because DOS is a command-based interface, DOS-based scripting (batch files) is a natural extension of the environment.

Consider the following four DOS commands:

c:
cd \windows\temp
attrib -r *.tmp
del *.tmp

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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