March 29, 2011

 Batch Files


You see your interpreter Dos contains a file called Command. Com. Which is the actual Command interpreter between you and your computer, which besides recognizing your Command also Contains a set of routines for processing batch files known as the batch file processor. Whenever you enter a Command the Processor checks if its an internal Command then if not it checks the disk for a file called by the given name. The Sequence of search is like this first it searches for the file with extension. Can, if not available it searches for the extension. Exe still it not available it searches for file with extension. BAT and Still not available it gives a message “bad command or file name'. See how true the command is if the file is founded with. BAT Extension the Control is taken over by the batch file processor. This Processor reads the Commands step by step and executes then one after another and when the commands are over it turns Control to the Command interpreter which is term returns you with the prompt. If you wish to stop or break the batch file extension is between then you press 'Control' and 'C' Key Combination the prompt you get is : terminate batch off  [Y/N]

If you type 'Y' it aborts the operation are 'N' is typed the execution Contains from that point from where the echo was suspended.


HOWTO CREATE A BATCH FILE :
      
To Create a Batch file two Commands are used - - - - - Copy can, Edit.
Type the following prompt: Copy con A.BAT and press
A means Name. BAT Extension. Here can means Console (your key board.

Prompt à Copy con A.BAT you will --- the cursor below 'A'.  Now Type DIR.
Copy A: ABC TXT b:
DEL A : ABC TXT
(1)

Now press F6 (or) Control + Z key Combination. In this it is A, so you type prompt à you will see the Command in the A.BAT Can right -- to action to so instead of typing all those Commands one after another performed the same job by Just typing the file name.


BATCH FILES :

(a)
ECHO
(b)
REM
(c)
CALL
(d)
PAUSE
(e)
@ COMMAND

Batch file have their own set of Suspended support Commands known as sub Commands. ,

BATCH COMMANDS :

ECHO
This Command is used to set the states of echo effect on or off. The default states of echo is on.
It is also used to display some massages on the monitor as the file is processed.
Syntax : ECHO ON / OFF,  MESSAGE


@:
This Command is used to suppress the any information following this Command.
Syntax : @ MESSAGE / COMMAND


REM:
This Command is used to make or notes in a file. The information or statement that follows the REM Command is not executable because REM is a NON Executable statement.
Syntax : REM Statement /                                  / [Command]


PAUSE:
It Pauses the command interpreter or processor for some time until we press any key from the key board.
Syntax : PAUSE
                It displays the following message [ press any key to continue]


CALL:
This command is used to call a batch file that is called is over that the control is return to the original batch file from where the batch file was called,
Syntax : Batch file name.


0 comments:

Post a Comment

Your Ad Here