views:

117

answers:

1

Why does running with elevated privileges force the use of UNC paths? I need to elevate my process AND keep the drive mappings I have. Yet when I run elevated the mappings are replaced with the UNC path. For example:

textBoxPath.Text = Application.StartupPath;

returns "F:\myProgram\tools" when run normally. But when run elevated it returns "\server\share\myProgram\tools"

I'd like to find a way to either convert the UNC to the mapped path or prevent it altogether.

Thanks

+3  A: 

The drive mappings are per-user. Your administrator user simply doesn't have the same mappings.

I fear there is no way to retain them, since, when elevated, you have a completely different user token.

Joey
Thanks, that makes sense. Doesn't make my life easier, but it makes sense. :)
JimDel