Is it possible to get the application data directory for a given user who is NOT the user running the program in C#?
Note: The LogonUser mechanism suggested may require more privledges than the application has. The registry mechanism is not really future-proof.
Brian
2009-08-13 14:27:11
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
2009-08-13 14:28:59
@Josh: Yeah, you're right.
Brian
2009-08-13 14:35:42
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
2009-08-13 14:25:01
A:
Given admin permissions, you should be able to find it. However, it really violates the spirit of that directory.
Austin Salonen
2009-08-13 14:26:58