中国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-08-01 19:02
48,037 topics / 350,122 posts / today 2 new / 48,249 members
DOS学习入门 & 精彩文章 (教学室) » Question
Printable Version  809 / 7
Floor1 hotdog Posted 2003-08-05 00:00
中级用户 Posts 78 Credits 411
@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
Floor2 电吉入侵 Posted 2003-08-05 00:00
初级用户 Posts 377 Credits 1,480
No.
Floor3 hotdog Posted 2003-08-05 00:00
中级用户 Posts 78 Credits 411
Floor4 sensen Posted 2003-08-05 00:00
初级用户 Posts 64 Credits 286
if errorlevel 1..... means that if the return value is greater than or equal to 1, it will execute the corresponding code.
Floor5 hotdog Posted 2003-08-05 00:00
中级用户 Posts 78 Credits 411
How many return values does it have?
Floor6 sensen Posted 2003-08-05 00:00
初级用户 Posts 64 Credits 286
That depends on what command the previous line of code is.
Floor7 hotdog Posted 2003-08-05 00:00
中级用户 Posts 78 Credits 411
Could you give an example?
Floor8 sensen Posted 2003-08-06 00:00
初级用户 Posts 64 Credits 286
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
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023