views:

664

answers:

3

Is it possible to get the application data directory for a given user who is NOT the user running the program in C#?

+2  A: 

http://stackoverflow.com/questions/198124/how-can-i-get-the-path-of-a-windows-special-folder-for-a-specific-user

Josh
Note: The LogonUser mechanism suggested may require more privledges than the application has. The registry mechanism is not really future-proof.
Brian
True, but I think any solution is going to require elevated privileges considering you are attempting to gain access to information in another user's account.
Josh
@Josh: Yeah, you're right.
Brian
A: 

One simple, slightly hacky way, is to get the %appdata% directory for the user who is running the program, then swap out their username with the username you are interested in. It should work 99% of the time, but might fail on rare occasions.

Brian
A: 

Given admin permissions, you should be able to find it. However, it really violates the spirit of that directory.

Austin Salonen