Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine Available Drives
Message
 
 
To
22/10/2003 11:06:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00841069
Message ID:
00841080
Views:
27
>I would like to populate a list with the drive letters of availble disk drives and shared drives. Is there a way to do this?
>
>Thanks in advance for you help,
>Russell

You can also use DRYVETYPE() function
DIMENSION laDrives[1,2]
lnDriveCount = 0
FOR i=ASC("A") TO ASC("Z")
	lnDriveType = DRIVETYPE(CHR(i))
	DO CASE
	CASE lnDriveType = 2
		lcDriveType = "Floppy"
	CASE lnDriveType = 3
		lcDriveType = "Local HD"
	CASE lnDriveType = 4
		lcDriveType = "Removable/Network"
	CASE lnDriveType = 5
		lcDriveType = "CD-ROM"
	OTHERWISE	
		lcDriveType = ""
	ENDCASE	
	IF NOT EMPTY(lcDriveType)
		lnDriveCount = lnDriveCount + 1
		DIMENSION laDrives[lnDriveCount,2]
		laDrives[lnDriveCount,1] = CHR(i)
		laDrives[lnDriveCount,2] = lcDriveType 
	ENDIF
ENDFOR
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform