in reply to Re: cross-platform way to get home directory
in thread cross-platform way to get home directory

Windows does have a home dir, but that's not where you want to place application settings

Application settings should go in a subdir of the directory specified by registry value
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Local Settings
The subdir should be of the form <company name>\<application name>.

Application data should go in a subdir of the directory specified by registry value
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Local AppData
The subdir should be of the form <company name>\<application name>.

Replace %USERPROFILE% with the value of $ENV{USERPROFILE}.

Replies are listed 'Best First'.
Re^3: cross-platform way to get home directory
by samtregar (Abbot) on May 15, 2006 at 20:00 UTC
    Windows may have something called a home directory, but it's basically useless. It doesn't have any of the useful meaning that $ENV{HOME} has on Unix.

    -sam

      What useful meaning does $ENV{HOME} have on Unix? Somewhere to put config files? yes ("Local Settings") Somewhere to put the user's personal files? yes ("My Documents")