What is Batch File?

by Mohan 2012-09-17 09:44:08

What is batch file?.



Batch files are the computer handyman’s way of getting things done. They can automate everyday tasks, shorten the required time to do something, and translate a complex process into something anyone could operate.

Example:



This example batch file displays "Good morning!", prompts and waits for the user to press a key, and terminates.

@ECHO off
ECHO Good morning!
PAUSE


Explanation:
The interpreter executes each line in turn, starting with the first. The @ symbol at the start of the line turns off the prompt from displaying that command. The command ECHO off turns off the prompt permanently, or until it is turned on again. Then the next line is executed, the ECHO Hello World! command outputs Hello World!, as only off and on have special functions. Then the next line is executed, the PAUSE command displays Press any key to continue . . . and pauses the script's execution until a key is pressed, when the script terminates as there are no more commands. In Windows, if the script is run within a Command Prompt window, the window remains open at the prompt as in MS-DOS, otherwise the command prompt windows closes on termination
745
like
0
dislike
0
mail
flag

You must LOGIN to add comments