in reply to Re: Windows convention for per-user configuration files for a Perl application
in thread Windows convention for per-user configuration files for a Perl application

That variable is supported on NT 4.0, and is a better way to do it. I'm really annoyed at myself for missing that, too!.

An even more important reason that this way is better is that although the user name is known, it's possible for one or more profiles to exist for a user. In my case, I have 'jcw' and 'jcw.000' as profiles on the machine, and 'jcw.000' is the active profile. If I were to use the username of 'jcw' to select where to write the profile, I would be writing it into the wrong directory.

Excellent call, the_slycer!

--Chris

e-mail jcwren
  • Comment on (jcwren) RE: (2) Windows convention for per-user config files for a Perl app

Replies are listed 'Best First'.
(tye)RE: Windows convention for per-user config files for a Perl app
by tye (Sage) on Oct 16, 2000 at 23:43 UTC

    But you don't select the username "jcw". You just write to and read from HKEY_CURRENT_USER!

    Now, if you wanted to set per-user items in the Win32 registry for other users, then I'd say "Give up".

    Note that I'm not advocating (nor discouraging) the use of the Registry for stuff like this. I find it a "mixed blessing" and have arguments on both sides.

            - tye (but my friends call me "Tye")
RE: (jcwren) RE: (2) Windows convention for per-user config files for a Perl app
by ddd (Acolyte) on Oct 17, 2000 at 20:05 UTC
    Every time that my NT box dies and the IT guys rebuild it my user profile directory changes...

    From a DOS window:

    C:\>echo My name is: %USERNAME% My home is %USERPROFILE% My name is: ddickinson My home is C:\WINNT\Profiles\ddickinson.002

    All the best,
    DouglasDD