On 04/24/15 01:57, MacArthur, Ian (Selex ES, UK) wrote:
>> Not sure why the User/Windows technique doesn't just use the HOMEPATH,
>> but maybe its poking around in the registry ends up resolving to that,
>> I'm not sure. I'll bet there's good reasons for what it does.. perhaps
>> Microsoft's own documentation covers this.
>
> In practice, it typically resolves to something like:
>
> C:\Users\<user_name>\AppData\Local\<vendor>\<appname> etc...
>
> Though depending on how your machine is set up, the "Local" part might be
> mapped into the "Roaming" profile. It might be this that makes it easier
> to check via the registry, since the registry will presumably know whether
> it is meant to map the local or roaming profile for any given login account...
Hmm, I thought the roaming profile stuff affects the contents
of the HOMEPATH variable?
https://technet.microsoft.com/en-us/library/cc766489%28v=ws.10%29.aspx
"""
Redirect to the following location:
This option redirects the named folder to the exact path listed in the Root Path.
This has the capacity to redirect multiple users using the same share path for
the redirected folder. You could use this option so multiple users have the
same Desktop or Start Menu.
Note
Folder redirection only supports %USERNAME%, %USERPROFILE%, %HOMESHARE%,
*and %HOMEPATH% environment variables.*
"""
I believe I use that for preferences in my fltk apps, and fall
back to the windows temp directory (with the user's name in the
filename) if that doesn't work.
I try to avoid the registry, so that when folks ask where the
preferences are, I just say "look in your %HOMEPATH%", as opposed
to having to go into regedit and walk through its hopelessly
byzantine maze of wacky key names.