windows 7 - Custom registry key deleted on reboot?

07
2014-07
  • NickHallick

    I have made a custom registry key (String Value) for identification of which computer a user logs on to. The problem is that this key is deleted whenever the computer is rebooted.

    The key is entered under Computer\HKEY_LOCAL_MACHINE

    I have already tried to set myself as the owner and gave my account all the permissions possible like read/write, however it is a strong possibility that I did that wrong.

  • Answers
  • Jet

    The problem (if we can call it so) is in Windows Registry architecture.
    HKLM hive doesn't exist on your computer. On each boot Windows "virtually" assembles that hive from some files which are located in \Windows\System32\Config folder. So any key created directly in HKLM will not be stored.

    But if you create a key inside existing subfolders of HKLM, it will be saved.
    If you still want to create a key in HKLM, I recomend you to create it in HKLM\Software, for example in: HKLM\Software\YourKeyFolder\YourKey
    Other subfolders are dangerous and may require higher privileges, so playing with them can damage the system or can cause serious security problems. If you want to know more, read this and this.


  • Related Question

    Unable to access a particular registry key
  • Josh Comley

    I am trying to install a hot fix for Visual Studio 2008, but each time the install fails, and the report in the log file is that the installer does not have access to:

    \\HKLM\Software\Classes\.map\OpenWithProgids

    If I load regedit.exe I can't access that key, I get an "Access denied" error.

    • I am a member of "Administrators"
    • I am the only non-system account on the machine
    • I have rebooted
    • I have "Run as Administrator" on the installer and on regedit.exe
    • I have enabled the Administrator account and logged on as such
    • I have tried to give myself permissions to the key
    • I have tried to give SYSTEM permissions to the key
    • I have tried to take ownership of the key

    I don't know what else to try, I am locked out of my own registry!

    Help!

    Edit:

    I'm using Windows 7


  • Related Answers
  • Tim Pietzcker

    Have you tried taking ownership of the key? In WinXP, you need to open the permissions dialog, click on "Advanced..." and then on the Ownership tab. Don't know if that still works in Win7.

  • Josh Comley

    Fixed!!!

    For anyone with the same problem in the future:

    I went to http://www.heysoft.de/old/RegDACLe.htm and downloaded RegDACL.

    I then ran the following command:

    regdacl HKLM\SOFTWARE\Classes\.map\OpenWithProgids /gga:F /ggu:R

    This gave full permissions to both administrators and users. I needn't have bothered with the users one, but hey ho.