Subj : Re: how to detect cdrom? To : Brian.Iglesias@xspamp0.f321.n751.z6 From : Outsider Date : Fri Feb 08 2002 07:51 am From: Outsider@f3.n342.z1.cereal.mv.com (Outsider) Subject: Re: how to detect cdrom? From: Outsider Brian.Iglesias@xspamp0.f321.n751.z6.fidonet.org wrote: > > hello everyone. > > i am looking for a generic batch routine that will detect the cdrom > and ramdrive. this is for a pcdos 2000 bootdisk. previously, > i was using msdos 6.22 with 'findramd.exe' (with setramd.bat) > from the win98se ebd, but when i moved it to pcdos it didn't work. > > i traced it and 'xmsdsk.exe' loads fine, but 'findramd.exe' does not > return the errorlevel like before. i have the feeling it doesn't like > non-MS dos'es. > > can this be done without using external utilities? Yes. It can even be done without 4DOS . Always assign drive letter Z to your CD-ROM drive. If you already know it is Z, there is no need to find it. Makes things a lot easier. Below is a suggested outline, make whatever changes you require. [Menu] menuitem=Windows menuitem=DOS menudefault=default,10 menucolor=15,3 numlock=off [common] DOS=HIGH,UMB DEVICE=C:\WINDOWS\HIMEM.SYS /testmem:off device=C:\WINDOWS\emm386.exe devicehigh=C:\WINDOWS\ifshlp.sys devicehigh=C:\WINDOWS\COMMAND\ansi.sys /x devicehigh=C:\WINDOWS\ramdrive.sys 8196 /E devicehigh=C:\WINDOWS\EBD\OakCDRom.sys /D:IDECD000 shell=C:\COMMAND.COM C:\ /f/e:2048/p break=on files=50 lastdrive=z device=C:\WINDOWS\COMMAND\display.sys con=(ega,,2) Country=001,850,C:\WINDOWS\COMMAND\country.sys [windows] [dos] @ECHO off verify on :: next line corrects a bug that sets the path incorrectly PATH; SET copycmd=/-Y SET temp=c:\temp SET tmp=c:\temp LH C:\WINDOWS\COMMAND\MSCDEX.EXE /D:idecd000 /L:Z >nul LH C:\WINDOWS\COMMAND\doskey /insert /bufsize:1024 C:\WINDOWS\COMMAND\MODE CON RATE=32 DELAY=1 PATH C:\WINDOWS;C:\WINDOWS\COMMAND;c:\ mode con codepage prepare=((850) C:\WINDOWS\COMMAND\ega.cpi) >nul mode con codepage select=850 >nul keyb us,,C:\WINDOWS\COMMAND\keyboard.sys PATH>C:\ORGPATH.BAT PATH=%PATH%;whatever;whatever IF not "%config%"=="" GOTO %config% GOTO dos :windows SET config= WIN.com :dos SET config= :: The RAMdrive letter is easy enough to find from a boot disk with a simple batch file. This method presumes that the RAMdrive has been correctly loaded, so that responsibility goes to you and your bootdisk. Since a RAMdrive is assigned after logical drives, the last writeable drive, excluding Z (which is the CD drive), is the RAMdrive - or the last RAMdrive if more than one is present. :: bframdrv.bat (Boot - Find RAM DRiVe BAT) @ECHO off IF not "%1"=="" GOTO recurs CTTY nul %0 c d e f g h i j k l m n o p q r s t u v w x y :recurs ECHO.> %1:\$flag1.tmp COPY/B/Y %1:\$flag1.tmp+,, %1:\ IF exist %1:\$flag1.tmp SET ram=%1 IF exist %1:\$flag1.tmp DEL %1:\$flag1.tmp SHIFT IF not "%1"=="" GOTO recurs CTTY con :: :: This batch gives you the RAM drive letter w/o pipes. :: Once you find out where the RAM drive is, the %temp% :: can then be set to it, afterwhich you may use pipes. -- MS-DOS 6.22, Windows for Workgroups 3.11, Netscape Communicator 4.08 -- |Fidonet: Outsider 1:342/3 | | Origin: The Cereal Port BBS (603)899-3335 199.125.78.133 (1:132/152) --- # Origin: (1:132/152.4) * Origin: Baddog BBS (1:218/903) .