China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 11:23
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Repost: Batch Files and Commands View 2,915 Replies 4
Original Poster Posted 2002-10-25 00:00 ·  中国 广东 佛山 禅城区 电信
元老会员
★★★★
Credits 5,170
Posts 1,637
Joined 2002-10-16 00:00
23-year member
UID 8
Gender Male
From 广东佛山
Status Offline
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.
我的网志
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
Floor 2 Posted 2003-06-21 00:00 ·  中国 四川 成都 中移铁通
高级用户
★★
Credits 617
Posts 115
Joined 2003-06-04 00:00
23-year member
UID 3497
Gender Male
Status Offline
Bump it up!!!
Are there any other commands????
Floor 3 Posted 2003-08-22 00:00 ·  美国
初级用户
Credits 128
Posts 8
Joined 2003-08-18 00:00
22-year member
UID 8783
Gender Male
Status Offline
I want to know more, thanks!
Floor 4 Posted 2003-08-22 00:00 ·  中国 湖南 长沙 电信
初级用户
Credits 188
Posts 23
Joined 2003-07-17 00:00
23-year member
UID 7056
Gender Male
Status Offline
Question about a batch command
EXTRACT /E /L %RAMDRIVE%\SYSTEM DOSET.CAB>NUL
What do the /E /L parameters mean? What does >NUL mean? Thanks!
Floor 5 Posted 2004-08-03 00:00 ·  中国 上海 宝山区 电信
初级用户
★★
Credits 217
Posts 55
Joined 2004-08-02 00:00
21-year member
UID 29516
Gender Female
Status Offline
Forum Jump: