We have an application that displays network drives programmatically. In Vista with UAC, we get some weird issues.
Our application maps the disk without being raised, therefore, if the user views the explorer and double-clicks to launch exe, it asks for UAC. So when they approve of it, it asks for the username / password for the share ... Strange, since the credentials are saved.
It turns out that a process with an elevated level cannot access the mapped drive that was mapped from an unextended process.
To see this problem in action, follow these steps:
- Run cmd.exe without UAC
- Run "net use w: \ yourHostname \ yourShare / user: yourUser yourPassword / persistent: yes"
- Run cmd.exe as administrator
- Type "w:" and see the error message
At this point, you can start the usual "network usage" and see that the connection on the elevated cmd is not available, but another failed cmd sees it as OK.
Does anyone know a workaround to fix this problem? or perhaps a way to map a network drive to All Users?
windows windows-vista uac file-sharing net-use
jonathanpeppers Aug 12 '09 at 15:52 2009-08-12 15:52
source share