What is a batch file?
Windows comes with a version of DOS, which allows you,exploiting the features and the sequence of commands in a script. Batch file, is a simple text file (ascii) with each line contains commands successively interpreted by DOS.
This file can be launched either from a DOS session or directly, by double clicking from Windows.
Creating a batch file
Prerequisites
- Uncheck the "Hide file extensions of the type known in the advanced options of Windows Explorer.
- Use a text editor that saves the file in plain text (not binary).
o Example: ( "Notepad"), "Edit" under DOS
Create file
- Open your text editor.
- Enter your command lines.
- Save your file with a.txt (plain text) and close it.
- Click once on the file name and then press the F2 key you are in "edit mode".
- Rename the file by replacing the extension. txt. Bat (or. Cmd for newer OS.
- When asked: "Are you sure you want to rename the file? The answer is "Yes".