BAT & CMD File Display
- You can create a BAT file in Notepad or any other text editing program. Open the text editor, type the desired commands, and then save the file with the “.bat” file extension.
- Batch files are often created to run repetitive tasks in DOS or Windows. An example of a BAT file that most users are familiar with is the “autoexec.bat” file. Commands that are included in this file are automatically executed when the operating system starts.
- You can open a BAT file in the Notepad text editor by running a command line statement in the DOS CMD window. Type “edit myfile.bat” at the CMD prompt where “myfile” is the name of your BAT file. Press “Enter.” The BAT file opens in Notepad and displays from the CMD prompt.
- To run a BAT file, you can double-click the file in Windows. However, you can also run the BAT file from the CMD prompt. Type the name of the file, with the “.bat” file extension, at the CMD prompt and press the “Enter” key. For example, type “myfile.bat” at the prompt and press “Enter.” The BAT file executes.
Create a BAT File
Using a BAT File
Edit BAT File from CMD Window
Run BAT file from CMD Window
Source...