How to create new DOS Batch File?
You can create batch files using any special Editor like Notepad, Wordpad or maybe Notepad++. We prefer using Notepad. Using notepad can lead to get detailed syntax of all DOS commands. Best practice of batch programming can be done using this editor.
Steps for Creating Batch File:
- Open Notepad.
- Type your set of desired DOS commands using which you want to control system.
- Save file as 'file_name.bat'. Make sure that your file name extension is .bat. It will look as follow:
Fig.: DOS Commands in Notepad
Fig.: Batch File Preview
Now, you can open this file just simply clicking Double click on it. It will execute sucessfully. The above file will delete all .tmp (Temporary files) from root of D:\ drive if existed. There is no requirement to open Command Prompt (cmd.exe).
Link this post on your Blog/Website :