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--