Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get number of drives on machine & their types in
Message
 
To
09/07/2004 12:47:29
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00922574
Message ID:
00922588
Views:
14
>how to get number of drives on machine & their types in VFP6

Rajesh,

There are a couple of ways. First, check out the DRIVETYPE() function. Then you could use the GetLogicalDrives() or GetLogicalDriveStrings() API call.
DECLARE INTEGER GetLogicalDrives IN Win32API
lndrives = GetLogicalDrives()
? BITTEST(lndrives, 0)
You can simply iterate through the bits using BITTEST() and any time it returns .T. add 65 to the bit value (0-25).

Next there's the Windows Script Host's Drives object.
oFSO = CREATEOBJECT('Scripting.FileSystemObject')
oDrives = oFSO.Drives
FOR EACH oDrive IN oDrives
  ? oDrive.DriveLetter 
NEXT
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform