Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does anyone know how I can get the UNC from a drive lett
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00530226
Message ID:
00530241
Views:
10
>subject says it all.
>
>Thanks.

try the following API call:

declare integer WNetGetConnection in Win32API ;
string @cLocalDrive, ;
string @cRemoteUNCBuffer, ;
integer @nSizeOfBuffer

lcBuffer = space(511)
lnResult = WNetGetConnection('S:', @lcBuffer, len(lcBuffer))

* Failed if lnResult # 0
* it's probably not a mapped drive,
* or nothing is mapped to it

return iif(lnResult = 0, left(lcBuffer, at(chr(0), lcBuffer) - 1), '')

PR
Previous
Reply
Map
View

Click here to load this message in the networking platform