Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Initialize Inactive Mapped Drive
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01438302
Message ID:
01438308
Views:
83
Try WNetAddConnection2 function with CONNECT_UPDATE_PROFILE flag set.

>Occasionally customers run into an issue where their persistent mapped drive, on reboot, does not initialize... it has a little red X icon if you view it from Windows Explorer. From a VFP application you can not access data that is stored on that mapped drive in this situation. Now, from Windows Explorer, if you click the mapped drive, Windows will initialize it and it is then available to the VFP application.
>
>I figured out (from someone here on the UT I'm sure) that the following will 'initalize' the mapped network drive, but this only works in Windows XP.
>
>
>LOCAL lcMappedDriveLetter
>lcMappedDriveLetter='x'
>DECLARE INTEGER WNetRestoreConnectionW IN Win32API  ;
>             INTEGER hwndParent, STRING @ lpDevice
>	
>=WNetRestoreConnectionW(0,STRCONV(STRCONV(lcMappedDriveLetter+':',1),5))
>
>
>
>Does anyone know how to do something like this in Vista / Windows 7?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform