Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drive letter
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00229198
Message ID:
00229242
Views:
15
>How do I know if a Drive Letter exist.

Hi Plinio,

To add to what John and Vlad have said, you can also access the Windows API, by calling either GetLogicalDrives() or GetLogicalDriveStrings(). I prefer using the former like this:
DECLARE INTEGER GetLogicalDrives IN Win32API
lndrives = GetLogicalDrives()
* If a bit is set the drive exists
* Test if F: exists
llresult = BITTEST(lndrives, 5)
The bits (0-25) represent whether or not a drive is mapped to that letter. Bit 0 is A:, bit 1 is B:, etc.
George

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

Click here to load this message in the networking platform