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-12 19:44
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Question for the experts: am I using findcd correctly! View 1,632 Replies 5
Original Poster Posted 2003-08-02 00:00 ·  中国 广东 肇庆 电信
初级用户
★★
Credits 286
Posts 64
Joined 2003-07-24 00:00
23-year member
UID 7394
Gender Male
Status Offline
@ECHO OFF ;turn off screen output
LH MSCDEX.EXE /D:mscd001 /D:mscd002 /D:mscd003 /D:mscd004
FINDCD>NUL ;use FINDCD to find 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 find 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 find the drive letter of the second CD-ROM
DREADY %CDROM% >NUL ;use DREADY to determine whether %CRDOM% is ready
IF ERRORLEVEL 2 FINDCD 3>NUL ;if it is not ready then use FINDCD to find the drive letter of the third CD-ROM
IF ERRORLEVEL 0 IF NOT EXIST %CDROM%\QW\QW.EXE FINDCD 3>NUL;if it is ready but there is no qw.exe then use FINDCD to find the drive letter of the third CD-ROM
DREADY %CDROM% >NUL ;use DREADY to determine whether %CRDOM% is ready
IF ERRORLEVEL 2 FINDCD 4>NUL ;if it is not ready then use FINDCD to find the drive letter of the fourth CD-ROM
IF ERRORLEVEL 0 IF NOT EXIST %CDROM%\QW\QW.EXE FINDCD 4>NUL;if it is ready but there is no qw.exe then use FINDCD to find the drive letter of the fourth CD-ROM
DREADY %CDROM% >NUL ;use DREADY to determine whether %CRDOM% is ready
IF ERRORLEVEL 2 GOTO END1 ;if it is not ready then jump to END1
IF ERRORLEVEL 0 IF NOT EXIST %CDROM%\QW\QW.EXE GOTO END2;if it is ready but there is no qw.exe then jump to END2
IF ERRORLEVEL 0 IF EXIST %CDROM%\QW\QW.EXE %CDROM%\QW\QW.EXE ;if it is not ready and QW.EXE exists, then run CDROM%\QW\QW.EXE
GOTO END3 ;jump to END3

:END1
ECHO Can not CD-ROM!

:END2
ECHO Can not QW.EXE!

:END3

=======================================

I always feel these statements are written in a very long-winded way, not concise or compact enough. Can they be revised to look a bit more professional? For example, how would this be written using locate or findcd /s?
Also, how should config.sys be written so DOS can find multiple CD-ROM drives. For example:
devicehight=oakcdrom.sys /D:mscd001 /D:mscd002 /D:mscd003 /D:mscd004
Correspondingly in autoexec.bat:
LH MSCDEX.EXE /D:mscd001 /D:mscd002 /D:mscd003 /D:mscd004
Is it correct to write it like this?













Floor 2 Posted 2003-08-02 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Use this for multiple CD-ROM drives:

DEVICE=VIDE-CDD.SYS /D:CDROM

LH MSCDEX /D:CDROM
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 3 Posted 2003-08-02 00:00 ·  中国 广东 肇庆 电信
初级用户
★★
Credits 286
Posts 64
Joined 2003-07-24 00:00
23-year member
UID 7394
Gender Male
Status Offline
The following is quoted from Wengier's post at 2003-8-2 11:42:09:
Use this for multiple CD-ROM drives:

DEVICE=VIDE-CDD.SYS /D:CDROM

LH MSCDEX /D:CDROM

Do you have to use "/D:CDROM" and can't use something like "/D:MSCD000"?
Floor 4 Posted 2003-08-02 00:00 ·  中国 广东 汕头 电信
银牌会员
★★★
Credits 1,451
Posts 446
Joined 2002-10-20 00:00
23-year member
UID 29
Gender Male
Status Offline
config.sys
device=cdrom.sys /d:pfcd

autoexec.bat
@ECHO OFF
LH MSCDEX.EXE /DFCD
FINDCD /S >NUL

CDA %CDROM1% >NUL
if errorlevel 1 GOTO CDROM2
IF NOT EXIST %CDROM1%\QW\QW.EXE goto cdrom2
goto end2
:cdrom2
CDA %CDROM2% >NUL
if errorlevel 1 GOTO CDROM3
IF NOT EXIST %CDROM1%\QW\QW.EXE goto cdrom3
goto end2
:cdrom3
CDA %CDROM3% >NUL
if errorlevel 1 GOTO CDROM4
IF NOT EXIST %CDROM1%\QW\QW.EXE goto cdrom4
goto end2
:cdrom4
CDA %CDROM4% >NUL
if errorlevel 1 GOTO end1
IF NOT EXIST %CDROM1%\QW\QW.EXE goto noqu
goto end2

:END1
ECHO Can not CD-ROM!
gogo end3

:noqw
echo qw.exe not found
goto end3

:END2
echo found qw.exe


:END3






Floor 5 Posted 2003-08-02 00:00 ·  中国 香港
管理员
★★★★
專業島民
Credits 4,869
Posts 1,633
Joined 2002-12-10 00:00
23-year member
UID 465
Gender Male
Status Offline
The following is quoted from Wengier's post at 2003-8-2 11:42:09:
Use this for multiple CD-ROM drives:

DEVICE=VIDE-CDD.SYS /D:CDROM

LH MSCDEX /D:CDROM
Using "CDROM" as the driver name is not good...
There will be problems when installing NT under DOS...
Because one of NT's installation files is called "cdrom.sys"
我的網站:http://mw16.2ya.com/ 我的網誌: http://scrappedblog.blogspot.com/
~
我的Winamp正在播放的歌曲:
Floor 6 Posted 2003-08-03 00:00 ·  中国 广东 肇庆 电信
初级用户
★★
Credits 286
Posts 64
Joined 2003-07-24 00:00
23-year member
UID 7394
Gender Male
Status Offline
Forum Jump: