How to save a command written in CMD

By Detector | 25 July 2008



This is a short CMD tip. If you like to execute several CMD/DOS commands one by one, and you don’t like to do it manually, you should save all of these commands in one file. There are two solutions to do that:

First solution – create a file in CMD:

  1. Click Start – Run – type CMD, press ENTER
  2. In the Command prompt window write: “Copy con dos.bat” – press ENTRE
  3. Write CMD/DOS commands which you like to execute one by one (press Enter (new line) after every new command)
  4. When you are done press CTRL-Z. This will save file “dos.bat” in the folder where CMD window is open by default.
  5. Type dos.bat in CMD and press Enter. All CMD/DOS command will be executed immediately.

Example:
Creating file Execute


Second solution – create a file in Notepad:

  1. From desktop – right mouse button – choose new – text document

  2. Change the name of the file to “dos.bat”
  3. Right mouse click on the file – choose Edit
  4. Write CMD/DOS commands which you like to execute one by one (press Enter (new line) after every new command)
  5. Save the file (in this case – on the desktop)
  6. Double click on the file “dos.bat” will execute CMD/DOS commands one by one.

Tags | , , ,

| |

2 Responses to “How to save a command written in CMD”

  1. gsr says:

    thanks :]

  2. Prasenjit says:

    Excellent article. Much appreciated!






Archives

Add to Technorati Favorites
website stats
TwitterCounter for @ukion