Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine Available Drives
Message
From
22/10/2003 12:40:01
 
 
To
22/10/2003 11:06:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00841069
Message ID:
00841130
Views:
22
Russell-

>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?

You have two possibilities, and George has pointed you to a third. For example,
LOCAL lnBuffSize, lcString, lnDrives, lni
lnBuffSize = 200
lcString = SPACE(lnBuffSize)

DECLARE INTEGER GetLogicalDriveStrings IN Win32API AS GetIt;
	INTEGER lnBuffSize, STRING  lcString

= GetIt(lnBuffSize,@lcString)

lnDrives = OCCURS( ":", lcString)

FOR  lni = 1 TO  lnDrives
	THIS.ADDITEM(ADDBS(SUBSTR(lcString, AT(":",lcString,lni )-1,2)))
ENDFOR
I just want to warn you that in any of these cases, if a mapped drive hasn't been connected yet, none of these methods will find them. This is a "gotcha" I ran into when I made a backup routine for a client.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform