Adding a new key under HKEY_LOCAL_MACHINE fails

  • Thread starter Thread starter JamesS
  • Start date Start date
J

JamesS

I'm trying to add a new key on an XP device directly under
HKEY_LOCAL_MACHINE. As soon as I right click and select new... key the
error message "cannot create key: Error writing to the registry." is
displayed. I can create a new key under HKLM\hardware. Why can't I create
one directly under HKLM? Is this a known issue and is there a workaround?

I also tried creating a .reg file and importing it. Regedit gives me a
message that the information in the .reg file was successfully entered into
the registry but when I check the registry it is not there. I've tried
changing permissions on the registry but that hasn't helped and as
administrator of this machine I already had full rights anyway.

Any help would be appreciated.

Thanks,
James
 
What are you logged in as?

Regsitry changes can only usually be made by administrator.
 
JamesS said:
I'm trying to add a new key on an XP device directly under
HKEY_LOCAL_MACHINE. As soon as I right click and select new... key the
error message "cannot create key: Error writing to the registry." is
displayed. I can create a new key under HKLM\hardware. Why can't I create
one directly under HKLM? Is this a known issue and is there a workaround?

Hi

It's the OS that imposes this restriction by design, and I don't know of a
workaround.
 
JamesS said:
'm trying to add a new key on an XP device directly under
HKEY_LOCAL_MACHINE. As soon as I right click and select new... key the
error message "cannot create key: Error writing to the registry." is
displayed. I can create a new key under HKLM\hardware. Why can't I create
one directly under HKLM? Is this a known issue and is there a workaround?

It is a result of structure of the registry. The major branches under
HKLM are called Hives, and each has its own file - SYSTEM - SOFTWARE
etc. Further structuring inside these is contained in the files, and
you can add to those, once you have got into the file. HKLM is really
just a root point for the structure, with these names known, but no
provision for adding further hives.
 
Back
Top