A. 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.
- Open Notepad.
- Enter the command
@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
@echo off
- at the top of the batch file.
- Select Save As from the file menu.
- Enter the batch file’s name as
"<name>.cmd"
- Be sure to enter the name in quotes, or Notepad will add .txt to the end.
- Run cmd.exe to start a command session.
- Enter the batch file’s name, without the extension.
End of Article


Anonymous User January 20, 2005 (Article Rating: