HKCU and HKU registry records


  1. Posts : 720
    Win10 x64 Pro - 2 desktops, 2 laptops
       #1

    HKCU and HKU registry records


    This is a bonehead question about the registry.
    Is the HKCU hive (if that's the right term) dynamically built from HKU\S-1-5-21-... records every time a user logged on?

    I want to make some changes to the registry records of product - copying hundreds of configuration records from an old release set to a new release set. I'm very aware that this may be a big blunder. The records are in both HKCU and my HKU. If I change the HKCU registry records and am blown out of the water, will logging off and back on get me back to the unchanged HKU copy, or does Windows keep the two sets in sync?

    I could (and probably will) export all the records I intend to change, but I could also just uninstall and reinstall the program if it fails to run. But I'm more worried about changing something I did not intend to change - something else in the HKCU hive.

    I will take a complete backup of my system before doing any of this and plan on doing a system restore if I really hose things over, but I would rather have a quicker and more simple recovery.
      My Computer


  2. Posts : 13,995
    Win10 Pro and Home, Win11 Pro and Home, Win7, Linux Mint
       #2

    I'm not great on the Registry but it is made up of 5 Hives or basically text files that Windows uses to know how to run itself and programs. I'd think those Hives are created when installing Windows and subsequently installing programs and messing with one may be as dire as preventing Windows from running properly if at all. I see those 2 Hives you mentioned are different, some things in one are in subkeys on the other.
    Attachment 118112
    This is a simplified view of the files when I once backed up the Registry several years ago on a different computer, haven't checked if Win10 has the same [now use a shortcut to create a new Restore Point when I need].
    Attachment 118111
      My Computers


  3. Posts : 720
    Win10 x64 Pro - 2 desktops, 2 laptops
    Thread Starter
       #3

    But obviously "current user" can change from moment to moment if multiple users are signed in on the same computer.

    All of the records I'm (hopefully) going to change are in HKCU\SOFTWARE\... and HKU\S-1-5-21-...\SOFTWARE\. (My SID. I don't know if there is a security issue by displaying it, but I decided not to.) At the moment, the records I'm concerned with are apparently the same in the two hives. (There are 622 of them. I'm not about to check all of 'em.)

    So are you saying that HKCU is not a current user's copy of his/her HKU records? If that is the case, I guess I would have to change both sets and use either Regedit or a system restore to back out the changes if I mess something up.
      My Computer


  4. Posts : 8,101
    windows 10
       #4

    You can just export the key and then import into the other you dont have to do one at a time. Messing with reg is a suicide mission
      My Computer


  5. Posts : 720
    Win10 x64 Pro - 2 desktops, 2 laptops
    Thread Starter
       #5

    Samuria said:
    You can just export the key and then import into the other you dont have to do one at a time.
    I'm not sure how to map what you've just said into what I'm asking about. I wasn't ever thinking of doing one at a time - not with 622 records.

    First though, I should say that this is mostly a "How does the registry work?" kind of question. I may not follow though on any of this, but I still have the questions.

    And I may have just found something on the web that answers my question:
    The HKEY_CURRENT_USER key is a link to the subkey of HKEY_USERS that corresponds to the user; the same information is accessible in both locations.
    My assumption that there are two sets of records may be wrong. There may just be twos sets of keys for one set of records. That makes sense and clarifies my recovery plans.



    Samuria said:
    Messing with reg is a suicide mission
    Yup. That's why backups are a good idea. Luckily, I' going to be messing with only software registry records for one product. Unless I totally mess up the whole registry I should just be damaging one program.
      My Computer


  6. Posts : 1,255
    Windows 10 Pro
       #6

    HKEY_CURRENT_USER is just a link to the key in HKEY_USERS for the current user. If you are working with your own profile you would use HKEY_CURRENT_USER.
      My Computer


  7. Posts : 720
    Win10 x64 Pro - 2 desktops, 2 laptops
    Thread Starter
       #7

    LMiller7 said:
    HKEY_CURRENT_USER is just a link to the key in HKEY_USERS for the current user. If you are working with your own profile you would use HKEY_CURRENT_USER.
    Oh, I knew that I should be working with HKCU. I was just hoping that HKU had a separate copy and that maybe I would get it back just by logging off and back on. Having both sets of keys pointing to same data makes much more sense, but it means I'm more likely to do damage. Oh well.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:09.
Find Us




Windows 10 Forums