Friday, April 27, 2012

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.
  • Batch File Notepad Editor Fig.: DOS Commands in Notepad
  • Save file as 'file_name.bat'. Make sure that your file name extension is .bat. It will look as follow:
  • DOS Batch File 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).

No comments:

Post a Comment