I am currently using:
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
To get the current user path AppData\Local. The program requires elevated privileges and runs it under a standard user session, prompting an invitation that requires credentials to log into the system. Registration as an administrator (another user), apparently, changes the active user for the program. The returned folder path is thus the administrator, not the one used by the standard user.
Expected Result:
C:\Users\StandardUser\AppData\Local
Actual result:
C:\Users\Administrator\AppData\Local
Is there a way to get the AppData \ Local path of a specific user? Getting a registered username or credentials is not a problem compared to getting a path for an arbitrary user. The application is based on WPF and its necessary privileges are set in the manifest file requestedEcecutionLevel (requireAdministrator).
source
share