Eric's Webspace

Windows 95 / DOS 7 Batch Programming

 
All the information from here on assumes you are familiar with the basic DOS commands and can create simple batch files. Described are common workarounds and methods to accomplish tasks not generally covered in the manuals.

Readme Where to get the "missing" DOS commands. Where to get help on DOS.

Sample Batch Files Maybe your problem has already been solved.

Getting User Input  Seven different methods spanning DOS6 through Windows 2000 (and XP). 

Creating Secondary Batch Files How to use a batch file to create another batch file or script as it is needed.

Processing a Line of Data The most widely-implemented method of processing lines involves getting the name of a batch file on the beginning of a line of data. This allows the data on the line to be passed as arguments to the batch file.

Processing Characters in a Word Once you know how to extract and work with the individual words in a line, you'll find yourself wanting to work with the individual letters in the words.

Processing Lists Assuming you know how to process individual lines, you have to find a way around DOS' annoying program flow. It never returns when you want it to. Here's how to keep DOS on task and process every line in a file.

Making and Processing Lists of File Names Actually just using the DIR command appropriately, then processing the result with the techniques shown above. But it is such a common question...

Stupid DOS Tricks These tricks aren't widely known and are almost never used. Usually because they never seem to apply to whatever it is you're working on at the moment.

NT Batch Programming  Not a tutorial, just a listing of code fixes for NT when the techniques shown on this page won't work.

Links:
In my opinion, all these links point to pages that are as good as -- or better -- than what I offer. Suggestions for new links are always welcomed.
Simon Shepard's ss64.com NT Syntax
Batfiles: The DOS Batch File Programming Handbook & Tutorial
EasyDOS Command Index
Frank-Peter Schultze
 
 

Lost? Look at the site map.

Bad links? Questions? Send me mail.

Google
Yahoo
Ask Jeeves