

Computer users would have the AUTOEXEC.BAT file set up the system date and time, initialize the DOS environment, load any resident programs or device drivers, or initialize network connections and assignments.Ī. When DOS loads, the file AUTOEXEC.BAT, when present, is automatically executed, so any commands that need to be run to set up the DOS environment may be placed in this file. In DOS, a batch file can be started from the command-line interface by typing its name, followed by any required parameters and pressing the ↵ Enter key.


The term "batch" is from batch processing, meaning "non-interactive execution", though a batch file may not process a batch of multiple data. A batch file may contain any command the interpreter accepts interactively and use constructs that enable conditional branching and looping within the batch file, such as IF, FOR, and GOTO labels. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file.

A batch file is a script file in DOS, OS/2 and Microsoft Windows.
