Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get the Path of logical drive
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00274325
Message ID:
00274342
Views:
20
>I need to know how to get the path of a logical drive.
>
>If I connect \\server\C to F: acrros the network neigborhood how can I get the path using the logical drive.
>
>I can do this with a MS-DOS command line: Net use F: \\Server\C /yes
>
>When I double click in My PC icon I see C in "Server" (F:).
>
>I think must exist an api call to get it.

Hi Jose,

I think what you're referring to the the server/volume. If so, the following will probably get the information you need:
DECLARE INTEGER WNetGetConnection IN Win32API;
  STRING @lpszLocalName, STRING @lpbuffer, INTEGER @lnbufsize
* lcdevice is something like F:
lcbuffer = SPACE(200)
lnsize = LEN(lcbuffer)
IF WNetGetConnection(@lcdevice, @lcbuffer, @lnsize) = 0
  lcbuffer = LEFT(lcbuffer, AT(CHR(0), lcbuffer) - 1)
ENDIF
George

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

Click here to load this message in the networking platform