Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

application which is elevated needs to get non-elevated mapped drives list

I know that a .NET application which is run as elevated cannot see the mapped drives of the user. I also know there is a registry hack to fix this (which involves a reboot).

I would like to create a different solution to this problem. Our application must run elevated and it relies heavily on the mapped drives that the user has created. I'd like to detect the mapped drives the user has, and map a similar bunch from the elevated application.

So the question is: how do I detect the mapped drives of the 'normal' user from an elevated application?

like image 811
flobadob Avatar asked Oct 06 '22 14:10

flobadob


1 Answers

If a mapped drive was mapped persistently (checkbox "reconnect at logon" enabled) then you can find it in the user's registry hive:

HKEY_CURRENT_USER\Network\<drive letter>

That key has a value RemotePath containing the UNC path.

like image 185
Helge Klein Avatar answered Oct 09 '22 03:10

Helge Klein