@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?
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?



FCD