We have a custom script that allows us to reset computers that are sent out which the computers are locked down so we have to run the program as an Administrator (elevated user). The goal is to delete a directory in the current users AppData\Local directory but when I get the path with the below code, its that of the elevated user that authorized the app to run. Anyway to get logged in user path instead?
string strDirectory =
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
Regular User: c:\Users\bob\AppData\Local\
Running As Administrator: c:\Users\Administrator\AppData\Local\