Subj : Re: how to detect cdrom? To : CBFalconer From : Steve Date : Fri Feb 08 2002 02:34 pm From: Steve@f3.n342.z1.cereal.mv.com (Steve) Subject: Re: how to detect cdrom? From: "E. S. (Steve) Fabian" 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. -- E. S. "Steve" Fabian ESFabian@BellAtlantic.net POB 1540, Cherry Hill, NJ 08034 Telephone: 856-354-1752 EMPIRE Consultants, Inc. Director, Software Development ------------------------------------------------------------------- -- |Fidonet: Steve 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) .