Rob van der Woude's Scripting Pages


Batch files

for DOS, OS/2, Windows 95/98, NT 4, 2000 and XP

Technically, DOS provides just eight basic batch file commands — CALL, ECHO, FOR, GOTO, IF, PAUSE, REM, and SHIFT — plus a tiny assortment of miscellaneous doodads: replaceable parameters, environment variables, labels, double == signs, and @ signs. That's it! Not too much to learn, even for the most fervent DOS-hater. But the tools these few commands can create will astonish you.

The quickest way to learn the "doings" and syntax for each of the commands is too use MS-DOS's HELP program. Want to check out CALL? Type either

    CALL /?   or   HELP CALL

at the prompt and DOS will display either a few lines of help (CALL /?) or open up its reference database (HELP CALL) with examples and usage syntax.

PC Computing - DOS Power Tools by Paul Somerson

Limited though it may seem to some, other people perform magic using DOS' batch language without "extensions".

Take a look at the tips and examples presented on these pages and in the links to other sites, and see for yourself that batch files are more powerful and versatile than you had ever thought possible.

Wherever "DOS" is referred to, MS-DOS 5 or any later version, including the COMMAND sessions of Windows NT and OS/2, is meant.
When "NT" is referred to, Windows NT 4 is meant, unless specifically stated otherwise. As far as I know most NT 4 commands work in Windows 2000. Where Windows 2000 has some additional functionality, the added options will be shown in magenta.
When "OS/2" is referred to, OS/2 Warp 3 or later is meant.

Windows NT 4 / 2000 / XP users, you can use AllHelp.bat or AllHelp.vbs to generate a list of commands available in your operating system (and in the language of your OS), as is explained on my AllHelp page.

The main focus of this site will be on COMMAND.COM's and CMD.EXE's internal commands and on undocumented features and unusual use of features.
On magic, more or less.

I'm always open to new tips and suggestions.
If you see a DOS version mentioned as a minimum requirement, remember that I do not have access to every DOS version, so I cannot and did not test every feature in every DOS version.
If you do find an error here, or if you know of any useful "hidden feature" of any Intel based operating system that you would like to share, please send a message to moc.eduowrednavbor@ofni .


(DOS) commands and their usage in batch files

page last modified: 2016-09-19