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 | [reply] |
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")
| [reply] |
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 | [reply] [d/l] |