In DOS, OS/2, and also Microsoft Windows, batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter.
A batch file may contain any command the interpreter accepts interactively at the command prompt. A batch file may also have constructs (IF, goto, Labels, call, etc.) that enable conditional branching and looping within the batch file.
Similar to job control language and other systems on mainframe and minicomputer systems, batch files were added to ease the work required for certain regular tasks by allowing the user to set up a script to automate them. When a batch file is run, the shell program (usually COMMAND.com or cmd.exe) reads the file and executes its commands, normally line-by-line. Unix-like operating systems (such as Linux) have a similar, but more flexible, type of file called a shell script.