I'm currently using:
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
To retrieve current user's AppData\Local
path. The program requires elevated privileges and running it under standard user session throws a prompt requiring administrator's login credentials. Logging as an administrator (different user) apparently changes active user for the program. The returned folder path is thus administrator's and not the one the standard user uses.
Expected result:
C:\Users\StandardUser\AppData\Local
Actual result:
C:\Users\Administrator\AppData\Local
Is there a way to get AppData\Local path of specific user? Getting logged user name or credentials is not an issue compared to getting the path for arbitrary user. The application is WPF based and its required privileges are set in manifest file by requestedEcecutionLevel (requireAdministrator)
.