Path: utzoo!attcan!ncrcan!ziebmef!stephen From: stephen@ziebmef.uucp (Stephen M. Dunn) Newsgroups: comp.sys.ibm.pc Subject: Re: Problems finding out how many drives a system has. Keywords: MSDOS, BUGS Message-ID: <1989May27.141946.21328@ziebmef.uucp> Date: 27 May 89 18:19:44 GMT References: <188@stpl.UUCP> Reply-To: stephen@ziebmef.UUCP (Stephen M. Dunn) Organization: Ziebmef Public Access Unix, Toronto, Ontario Lines: 24 Yes, if you ask DOS how many drives it has, it will always report 5 or more if you have a hard drive (or at least, in my experience ... maybe this is only with some versions of DOS). Here's a solution (I'm not sure where I picked it up from): 1. Do as Norton says and find out how many drives DOS reports. 2. If DOS says 2, you know you have a floppy-only system (although I'm not sure whether DOS says 2 even if you have 1 floppy or not ... if you don't need to detect whether B is real or virtual, then you don't need to bother looking any further). 3. If DOS says more than 2, then try setting the default drive to C, then D, etc. until DOS tells you the drive doesn't exist. If you're working on a networked system, you'll have to check every possible drive number, since the lettering of network drives is not always straight- forward (at my university, we have a network where A and B are your floppies, C is only available while booting and then becomes unavailabe, and the network drives are I, J and K. Drives C through H are unavailable). -- ------------------------------------------------------------------------------- ! Stephen M. Dunn stephen@ziebmef.UUCP ! DISCLAIMER: Who'd ever ! ! Take off to the Great White North eh, ya hosehead ! claim such dumb ideas? ! -------------------------------------------------------------------------------