I am trying to access some files on share. But instead of accessing the share directory i have mapped the drive to share (say z:\). Now when UAC is on (windows 7) and i try to access the z:\ it works fine, but when i try to access the code with a process that has been started with "run as administrator" option, i am not able to access the "z:\" drive.
Whats more confusing is that i have put try-catch for DirectoryInfo.GetAccessControl method with catch block for UnauthorizedAccessException & SystemException.
So when i try to access the "z:\" the exception is caught in SystemException & the actual exception type is System.InvalidOperationException and message is "Method failed with unexpected error code 3". shouldn't the exception thrown from inside the "GetAccessControl" method be UnauthorizedException?
Not allowing to access a "z:\" drive when "run as admin" though the share (accessed as UNC path) is accesible, is this an issue or feature?
BTW, i am also not able to access the z:\ on windows explorer if i start the windows explorer with "run as admin" option.