What is batch file?

A batch file is a text file with a .bat or .cmd extension. A batch file adheres to a syntax and a set of valid commands or instructions. To run a batch file, enter the file’s name. You don’t need to enter the .cmd or .bat extension. To write a basic batch file, perform the following steps.

1. Open Notepad.
2. Enter the command
3. @echo hello world Text that follows the echo command will output to the screen. The @ symbol suppresses the command from printing to the screen. To prevent commands from displaying for an entire batch file, enter
4. @echo off at the top of the batch file.
5. Select Save As from the file menu.
6. Enter the batch file’s name as
7. “<name>.cmd” Be sure to enter the name in quotes, or Notepad will add .txt to the end.
8. Run cmd.exe to start a command session.
9. Enter the batch file’s name, without the extension.

One Response to “What is batch file?”

  1. That is a great post - thanks!

Leave a Reply

You must be logged in to post a comment.