Batfiles: The DOS batch file programming handbook & tutorial

  • Author: Laurence Soucy
  • Format: online HTML
  • Price: free

This is an older book, written by a batch file enthusiast for batch file enthusiasts. The batch files are not written like a typical programmer would write them. All intermediate and advanced batch files include documentation, a built-in help function, are internally sectioned, and have clear beginning and ending markings. All commands are in uppercase, while documentation and comments are in lowercase. This is so code and text can be immediately distinguished from one another.

The book is divided into four main sections: Before you start, Basic batfiles, Intermediate batfiles, and Advanced batfiles.  These are further divided into numerically ordered chapters. At the time of this post, it seems that only the Basic section has been completed. Hopefully the author will find the time to finish the other two sections. But even without those sections, it is a quite usable beginners book.
It is not meant to be a book about DOS, which will be handled on a need to know basis in relation to batfiles. It must be pointed out, however, that DOS help is an important part of the curriculum and required reading.

The author believes that batch files should be as easy as possible to understand, while writing them, using them, and examining them several months later. Real case scenarios are used to show how a variety of problems can be solved with batch files.

Much of the book is quite old and written with real DOS in mind, and not emulated DOS from a command prompt in Windows 2000/XP/Vista. Keep this in mind as you read and follow the book. There are some things that will only work with real DOS, which Microsoft no longer includes with Windows.

Chapters include:

  • The boot process
  • Internal and external commands
  • Command hierarchy
  • Syntax and help.com
  • The DOS editor – your friend
  • Break and verify
  • Doskey.com
  • Echo, redirection and pipes
  • The call command
  • Using doskey to create a batch file
  • Prompt and path
  • Doskey macros
  • Variables and the Set command
  • Temp and copycmd variables
  • The environment
  • Comspec variable
  • Shell statement
  • The ansi.sys device driver
  • Set screen colors and text attributes
  • Remap the keyboard
  • Smartdrv.exe
  • Partition your hard disk
  • Using a RAM drive
  • Input and data directories
  • Optimize config.sys
  • Optimize autoexec.bat
  • Optimize BIOS
  • Simple batfiles
  • More simple batfiles
  • Fixed batfiles
  • Replaceable parameters
  • If
  • Smart batfiles

Visit: Batfiles