<p>Inside a service, what is the best way to determine a special folder path (e.g., &quot;My Documents&quot;) for a specific user? <code>SHGetFolderPath</code> allows you to pass in a token, so I am assuming there is some way to impersonate the user whose folder you are interested in.</p>
<p>Is there a way to do this based just on a username? If not, what is the minimum amount of information you need for the user account? I would rather not have to require the user's password.</p>
<p>(Here is a <a href="https://stackoverflow.com/questions/131716/get-csidllocalappdata-path-for-any-user-on-windows">related question</a>.)</p>

This information is stored in the registry in the key "HKEY_USERS\S-1-5-21-616815238-485949776-2992451252-3228\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders".
The "S-1-5-21-616815238-485949776-2992451252-3218" is the GUID of the user. You need to get this GUID to find the corresponding key and read it.
In
this
example they use SHGetFolderPath function you mention and there is a list with all special folders which might be helpful.
NOTE:
Microsoft discourages to use the registry key, since it is still there just for backward compatibility