• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Creating Batch Files

Creating Batch Files

Before getting started with some concrete batch file examples, you need to know how to create them. Here are a few things to bear in mind:

  • Batch files are simple text files, so Notepad (or some other text editor) is probably your best choice.

  • If you decide to use WordPad or another word processor, make sure that the file you create is a text-only file.

  • Save your batch files using the .bat extension.

  • When naming your batch files, don’t use the same name as a Command Prompt command. For example, if you create a batch file that deletes some files, don’t name it Del.bat. If you do, the batch file will never run! Here’s why: When you enter something at the prompt, Cmd.exe first checks to see whether the command is an internal command. If it’s not, Cmd.exe then checks for (in order) a .com, .exe, .bat, or .cmd file with a matching name. Because all external commands use a .com or .exe extension, Cmd.exe never bothers to check whether your batch file even exists!


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint