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 20:06
Original Poster Posted 2003-08-05 00:00 ·  中国 浙江 杭州 余杭区 电信
中级用户
★★
Credits 411
Posts 78
Joined 2003-07-27 00:00
23-year member
UID 7622
Gender Male
Status Offline
@echo off
choice /c:dem defrag,mem,end
if errorlevel 3 goto defrag
if errorlevel 2 goto mem
if errorlevel 1 goto end
Can it be changed to
if errorlevel 1 goto defrag
if errorlevel 2 goto mem
if errorlevel 3 goto end
or if errorlevel 3 goto end
if errorlevel 2 goto mem
if errorlevel 1 goto defrag
Floor 2 Posted 2003-08-05 00:00 ·  中国 广东 广州 白云区 电信
初级用户
★★★
Credits 1,480
Posts 377
Joined 2003-06-06 00:00
23-year member
UID 3875
Gender Male
Status Offline
No.
欢迎大家访问我的主页!
精品.爱好http://iso.533.net
Floor 3 Posted 2003-08-05 00:00 ·  中国 浙江 杭州 余杭区 电信
中级用户
★★
Credits 411
Posts 78
Joined 2003-07-27 00:00
23-year member
UID 7622
Gender Male
Status Offline
Floor 4 Posted 2003-08-05 00:00 ·  中国 广东 肇庆 电信
初级用户
★★
Credits 286
Posts 64
Joined 2003-07-24 00:00
23-year member
UID 7394
Gender Male
Status Offline
if errorlevel 1..... means that if the return value is greater than or equal to 1, it will execute the corresponding code.
Floor 5 Posted 2003-08-05 00:00 ·  中国 浙江 杭州 余杭区 电信
中级用户
★★
Credits 411
Posts 78
Joined 2003-07-27 00:00
23-year member
UID 7622
Gender Male
Status Offline
How many return values does it have?
Floor 6 Posted 2003-08-05 00:00 ·  中国 广东 肇庆 电信
初级用户
★★
Credits 286
Posts 64
Joined 2003-07-24 00:00
23-year member
UID 7394
Gender Male
Status Offline
That depends on what command the previous line of code is.
Floor 7 Posted 2003-08-05 00:00 ·  中国 浙江 杭州 余杭区 电信
中级用户
★★
Credits 411
Posts 78
Joined 2003-07-27 00:00
23-year member
UID 7622
Gender Male
Status Offline
Could you give an example?
Floor 8 Posted 2003-08-06 00:00 ·  中国 广东 肇庆 电信
初级用户
★★
Credits 286
Posts 64
Joined 2003-07-24 00:00
23-year member
UID 7394
Gender Male
Status Offline
FINDCD>NUL ;use FINDCD to look up the drive letter of the first CD-ROM
DREADY %CDROM% >NUL ;use DREADY to determine whether %CRDOM% is ready
IF ERRORLEVEL 2 FINDCD 2>NUL ;if it is not ready then use FINDCD to look up the drive letter of the second CD-ROM
IF ERRORLEVEL 0 IF NOT EXIST %CDROM%\QW\QW.EXE FINDCD 2>NUL;if it is ready but there is no qw.exe then use FINDCD to look up the drive letter of the second CD-ROM
DREADY has four values:
0:ready;
1:ready only;
2:not ready;
255:invalid
Forum Jump: