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-07-02 07:36
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » How to interpret this command? Please give me your advice... View 2,364 Replies 1
Original Poster Posted 2002-11-11 00:00 ·  中国 广东 广州 联通
初级用户
Credits 229
Posts 37
Joined 2002-11-09 00:00
23-year member
UID 207
Gender Male
Status Offline
This is how it is written in the book:

Run CHECKNEW.BAT from another batch program. In the parent batch program, you can include the command: call checknew

Suppose the parent batch program receives two replaceable parameters and wants to pass them to checknew.bat. You can use the command call checknew %1 %2 in the parent batch program.

Then I want to ask, in which aspect does the influence of these two %1 %2 parameters differ from the original without %1 %2? What can be done to the batch file with these parameters? Modify? Add? Or something else. Please give instructions and give an example, okay?????
Floor 2 Posted 2002-11-17 00:00 ·  中国 湖北 随州 电信
元老会员
★★★
Credits 1,987
Posts 632
Joined 2002-10-27 00:00
23-year member
UID 73
Gender Male
Status Offline
%1, %2, ... are replaceable parameters, which are equivalent to memory variables. %1 is the first parameter after the command, %2 is the second parameter after the command. ... %n is the nth parameter. It can be replaced with actual parameters. For example, DIR /W /P, then %1 = W, %2 = P, and it can also be passed to a sub-batch program. This is particularly useful in batch files. For example, you create an A.BAT with the content: CALL DIR %1 %2, then you execute A /W /P which is equivalent to executing DIR /W /P. Or you create a B.BAT with the content:
IF %1=D GOTO 1
GOTO END
:1
DIR
:END
Then you execute B /D, which executes the DIR command.

http://dos.e-stone.cn/dosbbs
uploadImages/200311161145850422.swf
Forum Jump: