Batch File Endnotes
Microcomputer/DOS Tutorial


Computer Studying

Navigation
{NavForms}

Virus Tutorial Map
Tutorial Map

The limits to the uses of batch files are found only in your imagination.

One batch file can call another, but the original file will loose control of the computer, so don't expect the first batch file to do anything of use after a second is called. DOS 3.3 introduced the CALL command to get around this limitation.

Some of the commands will even work directly at the DOS prompt. A batch file might not be necessary. The FOR..IN..DO command, for example, can be used outside of a batch file if you use only one percentage sign (%) to designate the variable instead of two.

If a batch file contains a syntax error in any of its commands, the file will stop execution at that point and you will be returned to the DOS prompt.

Finally, DOS "remembers" the disk that contains the batch file and the drive it was in. If you removed the original disk, DOS will ask you to replace it before going on.

A summary:

  • CALL Filename
    Calls a second batch file from within a parent.
  • ECHO ON -or- ECHO OFF -or- ECHO <Message>
    Turns command display on or off, or displays a message to the screen.
  • FOR %%Variable IN (Set) DO Command
    Allows use of a single batch command for several different variables.
  • GOTO Label
    Jumps to locations within a batch file.
  • IF Condition Command
    Permits conditional execution of commands, and
    where Condition is
    • ERRORLEVEL #
    • String1 == String2
    • EXIST Filename
  • PAUSE Message
    Halts execution until the user presses a key.
  • REM Message
    Displays a message to the screen if ECHO is on.
  • SHIFT
    Shifts command line parameters to the left by one.
  • @
    Turns display off for a single command

Keep Reading Programming Introduction


{NavBar}
Home | Products | Definitions | Newsletter | Virus Tutorial | Contact


FILExt is proudly hosted by DewaHost.com - a fast and reliable host for everyone!
DewaHost offers premium Web hosting starting from $8.95/month and a high speed file hosting service FileBurst!

Please use the contact form for questions or comments about this web site.
Copyright © 2001 Computer Knowledge, All Rights Reserved
Pray the Rosary for peace.