I'm looking for a good way to get the local application data folder for a specific user -- without having to enter the login details for that user.
SHGetFolderPath() can accept an access token for whatever user I want to get the local appdata folder for, but to get an access token, you have to provide the user's password. Also, according to the docs this isn't supported on <= Windows 2000.
The registry key HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folder contains the AppData value, which contains the location of the local appdata folder for the current user... so I could technically mount the HKCU hive for the specific user and access this value; however, Microsoft seems to strongly discourage the use of this key, and I've heard that it can occasionally be inaccurate as well.
Ironically, on Windows, an administrator account can easily access and modify all of the data in any user's appdata folder, if they just open up Explorer and browse to the correct location... but there doesn't seem to be an easy way to programmatically get the location of the appdata folder for a specific user.
So do I have any other options? Right now, accessing the registry (gasp) seems like the best option, but I'd like to use something official and not discouraged by Microsoft, if possible.
Any suggestions would be appreciated.