Where and when are these 2 system environment variables set?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

%AllUsersProfile%
%UserProfile%

Is there a registry hive where these are set?
Is there a .bat file or a .ini file where they are set?

I assume the AllUsersProfile is set some time during windows startup and
imagine that UserProfile must be set after a user logs in but can some one
explain exactly when these variables are set, and how/where they are set?

OS = Win XP Pro, SP2
 
These values come from the registry and are set by the Windows logon manager.
They are read from the ProfileList key in the registry under:

HKEY_LOCAL_MACHINE,"\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

The USERPROFILE information is take from the AllUsersProfile key under
ProfileList.

The USERNAME information ist taken from the current user's profile key which
has the format of S-1-5-21-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx where x
represents a decimal number.
 
I stumbled across the following only minutes ago and returned to share my
discovery. Finding that your reply confirms the location boosted my
confidence.

Thank you.

%AllUsersProfile% = concatenation of
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\ProfileList\ProfilesDirectory
and
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\ProfileList\AllUsersProfile

%UserProfile% =
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\ProfileList\S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxx\ProfileImagePath
 
Back
Top