In DBPro you can use built in functionality to retrieve a list of drives on your system;
perform checklist for drives
for f=1 to checklist quantity()
print checklist string$(f)
next f
wait key
but it won't tell you what sort of drive each one is, be it a hard drive, CD drive, etc.
This code will tell you that info, so you can easily write functions to get a list of CD drives for instance;
` list of constants as defined by Microsoft
` useful to know when Googling but not used
` by the code at all
#constant DRIVE_UNKNOWN = 0
#constant DRIVE_NO_ROOT_DIR = 1
#constant DRIVE_REMOVABLE = 2
#constant DRIVE_FIXED = 3
#constant DRIVE_REMOTE = 4
#constant DRIVE_CDROM = 5
#constant DRIVE_RAMDISK = 6
load dll "shell32.dll",1
for d=0 to 25 ` loop through all 26 drive letters (0=A upto 25=Z)
t=call dll(1,"RealDriveType",d) ` ask DLL what type of drive - returns 0 to 6
if t > 1 ` ignore any 0's or 1's
select t
case 2 : type$="Removable Drive" : endcase
case 3 : type$="Hard Drive" : endcase
case 4 : type$="Network Drive" : endcase
case 5 : type$="CD Drive" : endcase
case 6 : type$="RAM Disk" : endcase
endselect
drive$=chr$(65+d)
print drive$;" = ";type$
endif
next d
delete dll 1
wait key
end
Boo!