中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-30 16:44
47,813 topics / 349,918 posts / today 0 new / 48,279 members
DOS学习入门 & 精彩文章 (教学室) » Explanation of DOS Commands (I'm also a novice)
Printable Version  2,722 / 29
Floor16 kkqq123 Posted 2003-11-29 00:00
初级用户 Posts 28 Credits 236
Calling another batch program from a batch program.

CALL filename

batch-parameters Specifies command-line information needed by the batch program.

If command extensions are enabled, CALL changes as follows:

The CALL command now accepts labels as targets for CALL. The syntax is:

CALL:label arguments

A new batch file context is created with the specified arguments, and control is passed to the statement after the label is specified. You must "exit" twice by reaching the end of the batch script twice. The first time the end of the file is read, control returns to immediately after the CALL statement. The second time exits the batch script. Type GOTO /? to see the description of the GOTO : EOF extension, which allows you to return from a batch script.

In addition, batch script text parameter references (%0, %1, etc.) have changed as follows:


%* in a batch script indicates all parameters (such as %1 %2 %3 %4 %5 ...)

Substitution of batch parameters (%n) has been enhanced. You can use the following syntax:

%~1 - Remove quotes (" and expand %1
%~f1 - Expand %1 to a fully qualified pathname
%~d1 - Expand %1 to just a drive letter
%~p1 - Expand %1 to just a path
%~n1 - Expand %1 to just a filename
%~x1 - Expand %1 to just a file extension
%~s1 - Expanded path contains short names
%~a1 - Expand %1 to file attributes
%~t1 - Expand %1 to file date/time
%~z1 - Expand %1 to file size
%~$PATH:1 - Search directories listed in the PATH environment variable and expand %1 to the first fully qualified name found. If the environment variable name is not defined or the file is not found, this combination expands to an empty string

You can combine modifiers to get multiple results:

%~dp1 - Expand %1 to just drive letter and path
%~nx1 - Expand %1 to just filename and extension
%~dp$PATH:1 - Search directories listed in the PATH environment variable for %1 and expand to the drive letter and path of the first file found.
%~ftza1 - Expand %1 to a DIR-like output line.

In the above examples, %1 and PATH can be replaced with other valid values. The %~ syntax is terminated by a valid parameter number. %~ modifiers cannot be used with %*
Floor17 kkqq123 Posted 2003-11-29 00:00
初级用户 Posts 28 Credits 236
Displays or sets the active code page number.

CHCP

nnn Specifies the code page number.

Typing CHCP without a parameter displays the active code page number
Floor18 kkqq123 Posted 2003-11-29 00:00
初级用户 Posts 28 Credits 236
Displays the name of the current directory or changes the current directory.

CHDIR
CHDIR
CD
CD

.. Specifies to change to the parent directory.

Typing CD drive: displays the current directory on the specified drive.
Typing CD without parameters displays the current drive and directory.

Using the /D command-line switch, in addition to changing the current directory of the drive,
it can also change the current drive.

If the extended command name is enabled, CHDIR will change as follows:

The current directory string will be converted to use the case on the disk name. So,
if the case on the disk is like this, CD C : \TEMP will set the current directory to
C:\Temp.

The CHDIR command does not treat spaces as delimiters, so it is possible to change the directory name to a
subdirectory name with spaces but without quotes. For example:

cd \winnt\profiles\username\programs\start menu

Is the same as:

cd "\winnt\profiles\username\programs\start menu"

When the extended function is disabled, you must type the above command.
Floor19 kkqq123 Posted 2003-11-29 00:00
初级用户 Posts 28 Credits 236
Display or modify disk checks at startup.

CHKNTFS volume
CHKNTFS /D
CHKNTFS /T\r\nCHKNTFS /X volume
CHKNTFS /C volume

volume: Specifies a drive (followed by a colon), mount point,
or volume name.
/D Restores the computer to the default state, checks all
drives at startup, and runs chkdsk on drives with issues.
/T:time Changes the AUTOCHK initial countdown time to the specified
amount in seconds. If no time is specified, displays the current setting.
/X Excludes drives that are not checked at startup. Drives excluded
in the last execution of this command are invalid at this time.
/C Schedules checking of drives at startup, and runs chkdsk if the drive has issues.

If no command-line switches are specified, CHKNTFS displays the status of the problem bits for each drive.
Floor20 kkqq123 Posted 2003-11-29 00:00
初级用户 Posts 28 Credits 236
COMP ]

data1 Specifies the location and name of the first file to compare.
data2 Specifies the location and name of the second file to compare.
/D Displays differences in decimal format.
/A Displays differences using ASCII characters.
/L Displays the number of different lines.
/N=number Compares only the first specified number of lines in each file.
/C Compares files without distinguishing between uppercase and lowercase ASCII letters.
/OFF Does not skip files with the offline attribute set.

To compare a set of files, use wildcards in the data1 and data2 parameters.
Floor21 tanz Posted 2003-12-04 00:00
初级用户 Posts 17 Credits 166
A:\赤月1127>RD E:\Qq2003\10221811 /S /Q
Invalid switch - /S

The text you provided is already in English. So the output remains the same:

A:\赤月1127>RD E:\Qq2003\10221811 /S /Q
Invalid switch - /S
Floor22 tanz Posted 2003-12-04 00:00
初级用户 Posts 17 Credits 166
Thanks
Floor23 kkqq123 Posted 2003-12-05 00:00
初级用户 Posts 28 Credits 236
Display the contents of a text file.

TYPE filename
Floor24 kkqq123 Posted 2003-12-05 00:00
初级用户 Posts 28 Credits 236
Search for a string in a file.

FIND ] "string" filename]

/V Display all lines that do NOT contain the specified string.
/C Display only the count of lines that contain the string.
/N Display line numbers.
/I Ignore case when searching for the string.
/OFF Do not skip files with offline attribute set.
"string" Specifies the text string to search for.
filename
Specifies the file(s) to search.

If no path is specified, FIND searches the text typed in or generated by another command.
Floor25 kkqq123 Posted 2003-12-05 00:00
初级用户 Posts 28 Credits 236
Set default console foreground and background colors.

COLOR

attr Specifies the color attributes of console output

The color attribute is specified by two hexadecimal digits -- the first
is the background, the second is the foreground. Each digit can be one of the
following values:

0 = Black 8 = Gray
1 = Blue 9 = Light Blue
2 = Green A = Light Green
3 = Aqua B = Light Aqua
4 = Red C = Light Red
5 = Purple D = Light Purple
6 = Yellow E = Light Yellow
7 = White F = Bright White

If no argument is given, the command resets the color to what it was when
CMD.EXE started. This value is either from the current console window, the
/T switch, or the DefaultColor registry value.

If the COLOR command is executed with the same foreground and background
colors, the COLOR command sets the ERRORLEVEL to 1.

For example: "COLOR fc" produces bright red on bright white
Floor26 passer98 Posted 2003-12-25 00:00
初级用户 Posts 2 Credits 109
Thanks
Floor27 heiniao Posted 2003-12-26 00:00
初级用户 Posts 1 Credits 105
You can also refer to "Hongen Online - DOS".
Floor28 QUNET Posted 2003-12-28 00:00
初级用户 Posts 1 Credits 105
The "Quick Mastery of DOS 6.22" by Long Wang is really good.
Floor29 ♂一切随风 Posted 2003-12-28 00:00
初级用户 Posts 5 Credits 118
It is pretty good
Floor30 Sub Posted 2003-12-30 00:00
初级用户 Posts 3 Credits 112
Internet fees are expensive~~~~~Can you organize it?~~~`~~It would be even better if it could be packed and taken away~~`
Prev  1 2
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023