Batch Files and Commands
In the DOS operating system, you can often see some files with the extension BAT. What kind of files are these? What do they do? How are they made up? This is what is covered in this section.
Batch Files
A batch file is a text file with the extension “BAT” in which a series of commonly used commands are written as if writing a program. Such a file is called a batch file. To run this batch file, just enter the filename of this batch file and press Enter, and the batch file will run all or part of the specified commands according to the commands in the file. Using batch files can simplify work and bring many conveniences.
Batch files can be created with software that has text editing functions, such as EDIT, WPS, CCED, etc.; even the COPY CON command can be used.
A batch file can contain the following commands and statements: DOS internal and external commands, command files with extensions COM, EXE, BAT, and batch commands.
A file named AUTOEXEC。BAT is called an automatically executed batch file, and is a special batch file. When the computer starts, it will be searched for and automatically executed.
Batch commands (batch commands for short)
1. ECHO command
Function: Allows or forbids the screen to display the commands executed in the batch file.
Format: ECHO
Parameter explanation:
ON allows the following commands to be displayed on the screen when executed.
OFF causes the following commands not to be displayed on the screen when executed.
@ECHO.. means even this ECHO command itself is not displayed.
ECHO+ means display one blank line.
MESSAGE is information specified by the user; regardless of whether ECHO is currently ON or OFF, this information will be displayed on the screen when executed.
2. REM command
Function: Add comments in a batch file.
Format: REM
Parameter explanation:
string The content of the comment, up to 123 characters.
3. CALL command
Function: Call and execute another batch file from one batch file; after execution is complete, return to the first batch file and continue execution.
Format: CALLfilename
Parameter explanation:
d:The drive where the called batch file is located.
Path The path where the called batch file is located.
Filename The name of the batch file being called.
In the DOS operating system, you can often see some files with the extension BAT. What kind of files are these? What do they do? How are they made up? This is what is covered in this section.
Batch Files
A batch file is a text file with the extension “BAT” in which a series of commonly used commands are written as if writing a program. Such a file is called a batch file. To run this batch file, just enter the filename of this batch file and press Enter, and the batch file will run all or part of the specified commands according to the commands in the file. Using batch files can simplify work and bring many conveniences.
Batch files can be created with software that has text editing functions, such as EDIT, WPS, CCED, etc.; even the COPY CON command can be used.
A batch file can contain the following commands and statements: DOS internal and external commands, command files with extensions COM, EXE, BAT, and batch commands.
A file named AUTOEXEC。BAT is called an automatically executed batch file, and is a special batch file. When the computer starts, it will be searched for and automatically executed.
Batch commands (batch commands for short)
1. ECHO command
Function: Allows or forbids the screen to display the commands executed in the batch file.
Format: ECHO
Parameter explanation:
ON allows the following commands to be displayed on the screen when executed.
OFF causes the following commands not to be displayed on the screen when executed.
@ECHO.. means even this ECHO command itself is not displayed.
ECHO+ means display one blank line.
MESSAGE is information specified by the user; regardless of whether ECHO is currently ON or OFF, this information will be displayed on the screen when executed.
2. REM command
Function: Add comments in a batch file.
Format: REM
Parameter explanation:
string The content of the comment, up to 123 characters.
3. CALL command
Function: Call and execute another batch file from one batch file; after execution is complete, return to the first batch file and continue execution.
Format: CALLfilename
Parameter explanation:
d:The drive where the called batch file is located.
Path The path where the called batch file is located.
Filename The name of the batch file being called.
我的网志
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos



