![]() |
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-12 17:51 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS学习入门 & 精彩文章 (教学室) » Question for the experts: am I using findcd correctly! |
| Printable Version 1,630 / 5 |
| Floor1 sensen | Posted 2003-08-02 00:00 |
| 初级用户 Posts 64 Credits 286 | |
|
@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? |
|
| Floor2 Wengier | Posted 2003-08-02 00:00 |
| 系统支持 Posts 10,521 Credits 27,736 | |
|
Use this for multiple CD-ROM drives:
DEVICE=VIDE-CDD.SYS /D:CDROM LH MSCDEX /D:CDROM |
|
| Floor3 sensen | Posted 2003-08-02 00:00 |
| 初级用户 Posts 64 Credits 286 | |
The following is quoted from Wengier's post at 2003-8-2 11:42:09: Do you have to use "/D:CDROM" and can't use something like "/D:MSCD000"? |
|
| Floor4 pfox | Posted 2003-08-02 00:00 |
| 银牌会员 Posts 446 Credits 1,451 | |
|
config.sys
device=cdrom.sys /d:pfcd autoexec.bat @ECHO OFF LH MSCDEX.EXE /D FCDFINDCD /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 |
|
| Floor5 Roy | Posted 2003-08-02 00:00 |
| 管理员 Posts 1,633 Credits 4,869 | |
The following is quoted from Wengier's post at 2003-8-2 11:42:09: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" |
|
| Floor6 sensen | Posted 2003-08-03 00:00 |
| 初级用户 Posts 64 Credits 286 | |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |