>Nevermind - it works for me too.
Were you having some kind of trouble?
What has been happening is when our wireless users leave the office and/or when we restart the server, they are not able to launch my app. It seems the mapped drive has gone dormant. WNetRestoreConnection - I think that's it - doesn't work and according to Christof - has been retired as of Windows Vista.
If the user used Windows Explorer and clicked on drive W they could see the files and thereafter the app would launch. What I did with these functions was attempt to disconnect the drive. If that worked, I reconnected the drive. Other folders on the server are accessible, so I created a file on the server with the user ID and password - permissions set to make it visible only to each user and the admins.
My loader program opens that file, and makes the connection, copies the exe to the local PC and launches it. Sledgehammer style fix, but it seems to be working. Our network admin thought he had it fixed permanently for one user, but when that user finally exhibited the problem again, I had to fix it.
I see it as a lock on the server and a key for each user also obtained from the server. It should be secure enough.
>
>
>>Woohooo! That's the ticket! Well I took the netresource class definition from that older piece of code, added it to the newer one (which you sent earlier) and it worked.
>>
>>Finally! :)
>>
>>Thanks
>>
>>
>>>Mike,
>>>
>>>See
Re: WNetAddConnection2 Message #
531154>>>
>>>>>Check
Re: Mapping to network drive using .BAT file Thread #
888895 Message #
889197>>>>
>>>>Hi Sergey
>>>>
>>>>That code is the cleanest sample of all. It uses struct too which is good. However there is no NETRESOURCE class definition in struct.vcx so it fails here:
>>>>
>>>>loNetResource = CreateObject("NETRESOURCE")
>>>>
>>>>Thanks