Subj : Re: how to detect cdrom? To : Steve From : CBFalconer Date : Fri Feb 08 2002 06:07 pm From: CBFalconer@f3.n342.z1.cereal.mv.com (CBFalconer) Subject: Re: how to detect cdrom? From: CBFalconer "E. S. (Steve) Fabian" wrote: > > CBFalconer wrote: > > > > Stan Brown wrote: > > > > > > E. S. (Steve) Fabian wrote in > > > comp.os.msdos.4dos: > > > >Locating a virtual [ram] disk is not trivial. > > > > > > Those who have an installation of Windows 9x will find a 7 KB > > > program > > > C:\WINDOWS\COMMAND\EBD\FINDRAMD.EXE > > > that returns 3-26 in ERRORLEVEL for RAM drive as C through Z. The OP > > > wanted a generic PC-DOS solution. I don't know whether FINDRAM will > > > run in a 16-bit environment, but it might be worth a try. > > > > It should, since that directory is what W98 puts in an emergency > > boot disk. > > > > What FINDRAMD.EXE does (and the Win98 version does work under MS-DOS > 6.22) is locate the alphabetically first drive with label "MS-RAMDRIVE", > and returns a corresponding errorlevel. If you have a mounted partition, > a mapped netowrk drive, or a CD-ROM with that label, FINDRAMD will find > that. If you change the label of your virtual disk to something else > than "MS-RAMDRIVE", it will not find it at all. If you have more than > one, too bad. > > If you use a JPsoft command processor, e.g., 4DOS, (and why would you > read this forum otherwise), you can emulate FINDRAMD.EXE with the code > below with some enhancements: > > unset v > DO dn = %@ascii[d] to %@ascii[z] > set d=%@char[%dn]: > if %@ready[%d] EQ 0 iterate > if %@cdrom[%d] NE 0 iterate > if %@removable[%d] NE 0 iterate > if %@remote[%d] NE 0 iterate > switch %@label[%d] > case MS-RAMDRIVE .or. VIRTUALDISK > set v=%d > leave > endswitch > ENDDO > unset d dn > > At this point the variable v is either set to X: where X is a drive > labeled as virtual, or it is undefined. Sounds like you pulled it apart looking for undocumented system calls. I'll take your word for it. -- Chuck F (cbfalconer@yahoo.com) (cbfalconer@XXXXworldnet.att.net) Available for consulting/temporary embedded and systems. (Remove "XXXX" from reply address. yahoo works unmodified) mailto:uce@ftc.gov (for spambots to harvest) -- |Fidonet: CBFalconer 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) .