MS-DOS has facility of combining one or more instructions into a file which can be activated and implemented successively. Such a text file having extension .BAT which stores the instructions is known as batch file.
If we activate a batch file, the operating system reads the separate command and executes these in the given order of sequence.
Creating a batch file
The COPY CON command enables us to create a batch file.
Example 1
C:\>COPY CON SCHOOL.BAT (press enter key)
Example 2
C:\>COPY CON DILASHA.BAT ( press enter key)
ECHO
ECHO command used in a batch file switches the display of the instruction and commentary on and off along with the text.
ECHO ON : Displays instruction.
ECHO OFF : Does not display but execute instructions.
If you do not want to display the ECHO command itself place the at sign (i.e. @) in front of ECHO OFF. The batch file can be run with its name (extension is optional)
Example 3
C:\.COPY CON LEARNBAT.BAT ( press enter key )
It allows you to create the batch file LEARNBAT.
No comments:
Post a Comment