Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to force reconnection of a network mapped drive?
Message
From
04/11/2002 16:54:13
 
 
To
04/11/2002 14:09:34
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00713586
Message ID:
00718714
Views:
16
>Great big ol' wet kisses to you and George (and honorary smooches to Alan, Jose, Mark, and James for helping with ideas.
>
>This finally did the trick!
DECLARE INTEGER GetForegroundWindow IN WIN32API
>
>DECLARE INTEGER WNetRestoreConnectionW IN Win32API  ;
>             INTEGER hwndParent, STRING lpDevice
>LOCAL lnHwnd as Integer
>lnHwnd = GetForegroundWindow()
>lnError=WNetRestoreConnectionW(lnHwnd,STRCONV(STRCONV('L:'+CHR(0),1),5))
>?lnHwnd, lnError, DRIVETYPE("L")
>
>
>Haven't sussed the syntax for doing it with a null parameter. Passing 0 for lpDevice just doesn't work. No error, but no reconnection, either. For now, as long as I can iterate thru all the possible drive letters, I'll be happy.
>
>Thank you _so_ much.

No problem - I'll collect on the kiss the next time I make it out to Seattle...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform