Basics of BATCH(.BAT) File
Introduction
A batch file is a script file in windows.
It is a plane text file which contains series of commands which needs to be executed by command line interpreter.
Batch files have .bat as extension.
Steps to create a batch file:
Step 1:Create a new text document
Step 2:Rename the file as per your choice and in the extension replace ".txt" by ".bat"
Step 3:Now Right click on the bat file and click on edit
Step 4:Type commands which needs to be executed and save the file.
Basic Commands:
- cls -This command is used to clear the screen
- ECHO - This command is used to display output to screen
- The other variants of ECHO are:1.ECHO OFF- Doesnt display DOS commnads on the screen2.ECHO ON- Displays DOS commands on the screen
- .Timeout seconds-It waits for specified amount of time(Seconds) before executing next command.User can skip the timer by pressing any key
- .Pause - Pauses the running of a batch file and displays the message "Press any key to continue ..." on the screen
- The other variants of Pause commands are:1.pause {Displays "Press any key to continue ...".}2.pause < nul {Waits with no comment.}
- SET- Set will view the DOS environment or create, change, or delete environment values.
No comments:
Post a Comment