DEFAULT user hive, which is a reference to the HKEY_USERS\S-1-5-18 hive.If the process is run by a logged in local or Domain user, then the HKEY_CURRENT_USER hive references that of the current logged in user. If a domain user then logs in second and has the same name, a .domain extension is added.The HKEY_USERS equivalent would be something like the following: HKEY_USERS\S-1-5-21-1937564237-1933792563-196172844-1031 The long string is a Security ID or SID. If a local user logs in second and has the same name, a .computername extension is added.
This registry key is not a user hive, but is just another reference to a key inside the same user hive: HKEY_USERS\S-1-5-21-1937564237-1933792563-196172844-1031\Software\Classes. Registry keys can also be queried and the values can be accessed and used in a batch file.
Now that you know how all registry keys can be accessed from HKEY_LOCAL_MACHINE and HKEY_USERS, and how to find out which user key is which, it is now time to determine the best method for updating a registry key. Example 1The LDClient directory may be in different places on different agent workstations.
The way a batch file is written to deploy as a Distribution Package is different than the way it would be written to be run by a user who double clicks on it. Some XP embedded workstations don't even have a C drive.
Before modifying or querying a registry key, it is important to understand the options available to you for doing so.
This document focuses on working with Registry keys in a batch file.
All registry keys are accessible at all times through the following hives: HKEY_LOCAL_MACHINEHKEY_USERS While there appear to be other hives, these are actually just reference locations that already exist under the above two hives. It means that if hive X references hive Y, then both hives are the exact same hive with just different names pointing to the same place.
Making a change to either hive X or Hive Y modifies the same hive since they both are just name references for the same hive.
There is the misconception that the only way to modify a user's registry key is to modify HKEY_CURRENT_USER, which is not the case.
Each user's registry hive is available under HKEY_USERS.
HKEY_CURRENT_USER actually references the hive under HKEY_USERS.
If the process is run by Local System, the HKEY_CURRENT_USER hive references the HKEY_USERS\.