Subj : Re: how to detect cdrom? To : Jasen.Betts@xspamp42.f531.n640.z3.f From : Outsider Date : Sun Feb 10 2002 10:06 am From: Outsider@f3.n342.z1.cereal.mv.com (Outsider) Subject: Re: how to detect cdrom? From: Outsider Jasen.Betts@xspamp42.f531.n640.z3.fidonet.org wrote: > > Hi Outsider. > > 08-Feb-02 08:03:56, Outsider wrote to Outsider > > O> ECHO %1|CHOICE /N/CABCDEFGHIJKLMNOPQRSTUVWXYZ >NUL > O> FOR %%d in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do IF > O> errorlevel H%%d set ramdrive=%%d > > what version of dos does that need to work? (it sure doesn't work here with > 6.22) I should have explained that part of the batch. The above code works if the correct drive letter is passed as parameter one only. I used it for verification purposes. This is not errorlevel, it is called bennylevel, and works like this: Findramd.exe For %%D In (C D E F G H I J K M N O P Q R S T U V W X Y Z) Do If ErrorLevel H%%D Set RAMD=%%D > O> I prefer the simple batch method to find the RAMdrive for two reasons. > > what simple batch method? > Simply this. 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. Occupies only one cluster on a 1.4MB floppy. -- 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) .