Unable to remove any registry key in the HKEY_LOCAL_MACHINE hive

Discussion in 'Windows 7 Help and Support' started by hasek747, Jun 26, 2011.

  1. hasek747

    hasek747 New Member

    Joined:
    Jun 22, 2011
    Messages:
    20
    Likes Received:
    0
    Hi guys,

    I cannot, for the life of me, delete any key in the HKLM hive. Things I've tried:
    1. Logging in as administrator
    2. Running an elevated regedit
    3. Setting Full Permissions to edit the key
    4. Taking ownership of the key
    5. Doing all of the above in regedt32
    6. Running in safe mode
    7. Malwarebyte's Reg Assassin
    8. Reinstalling Windows (I didn't reinstall for this purpose, I had a different reason for doing so, but the reinstall didn't change anything.)
    I'm running Windows 7 Ultimate. Any help? I'm getting frustrated :)
     
  2. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    What happens when you try and fail? Any error messages, prompts or anything.
    Have you tried with the plain vanilla regedit rather than regedt32? Are the results the same?
     
  3. hasek747

    hasek747 New Member

    Joined:
    Jun 22, 2011
    Messages:
    20
    Likes Received:
    0
    Hi, thanks for trying to help!

    Yes, I do get an error, it reads:

    "Cannot delete [key name]: Error while deleting key.

    And to answer your other question; I have done everything in both regedt32 and plain old regedit - the results were the same.

    Any ideas?
     
  4. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    From your original post you seemed to indicate that it was a wide spread problem
    but I really can't imagine anyone just willy nilly attempting to delete random keys especially in that HIVE. So is it a particular key or two or a particular data value that you are trying to delete? The reason I ask is because of problems with embedded Null characters in some keys, take a look at this article and see if you think the tool there might do the trick
    Unable to delete certain registry keys - Error while deleting key
     
  5. hasek747

    hasek747 New Member

    Joined:
    Jun 22, 2011
    Messages:
    20
    Likes Received:
    0
    Hi again,

    I am trying to delete keys in USBStor and similar - need to remove traces of certain USB devices being connected to my machine in the past.

    The reason I said it was a widespread problem is because I have no trouble deleting keys from other hives (I do that often,) so I backed up HKLM and tried deleting some other random keys and couldn't get it to work.

    I'll take a look at the article, thanks a lot!
     
  6. hasek747

    hasek747 New Member

    Joined:
    Jun 22, 2011
    Messages:
    20
    Likes Received:
    0
    Tried RegDelNull, unfortunately didn't help :(
     
  7. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    Running out of ideas here.
    I know you've said that you've done this already but just try adding the everyone group full permission to the key and make sure that you cascade it down to all sub containers
    Open regedit
    Right click the key and choose "Permissions"
    In the Group or user names: frame click the add button, then advanced, then find now, scroll as needed and select Everyone then OK twice, then make sure that everyone is selected in the top frame and check the Full Control check box and then click the "Advanced" button, uncheck "Include inheritable permissions from this object's parent" (this will break inheritance so make sure you really want this to happen) All you want left is the Everyone Group = Full Control and then check the box that says "Replace all child object permissions with inheritable permissions from this object" OK your way back out of there and see if that helps anything at all with your problem. My main concern is that you may have conflicting group memberships for the username that you are using, you may be part of the administrators group with full control and then also be part of the users group with read only permission, so you are going to end up with read only rights and unable to delete. At least that's what I'm thinking and of course the Registry Editor disclaimer:
    Using the Windows Registry Editor can cause serious, system-wide problems that may require you to re-install Windows to correct them. It cannot be guaranteed that any problems resulting from the use of the Windows Registry Editor can be solved. If you choose to edit the Windows Registry you do so at your own risk so unless you feel fairly comfortable and confident you should probably not use the Editor. Changes made to the Windows Registry can take effect immediately and those that do not will take effect following the next reboot of your computer, and a current backup is not automatically made for you....So manually create a system restore point, backup the registry and export the key you are editing for safe keeping before doing so.
     
  8. hasek747

    hasek747 New Member

    Joined:
    Jun 22, 2011
    Messages:
    20
    Likes Received:
    0
    Thanks for your time Trouble.

    Actually, something weird just happened. When I check the Replace all child object permissions with inheritable permissions from this object box and hit OK, I get the following error:

    Registry Editor could not set security in the key currently selected, or some of its subkeys.

    What do you make of this?

    Getting the exact same error for the administrator account as well.
     
    #8 hasek747, Jun 26, 2011
    Last edited: Jun 26, 2011
  9. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    Not exactly sure, perhaps your earlier efforts to take ownership of one of the parent keys was not successfully cascaded down to subs.
    You may have to trouble shoot this by drilling down to subkey containers and ascertaining their individual properties pertaining to ownership and permissions.
    Seems to me that there should be an easier way of doing this have you taken a look for utilities like Nirsoft's USBDeView, seems in the past that I have used this or a similar utility to remove references to old, unused USB devices. But I'm not sure that any such utility will remove all registry keys related to the device or not.
     
  10. hasek747

    hasek747 New Member

    Joined:
    Jun 22, 2011
    Messages:
    20
    Likes Received:
    0
    Yes, I've used USBDeView and tried to take advantage of it somehow; unfortunately it doesn't do what I require (registry entries remain.) I have done this kind of cleaning many times in Windows XP without any trouble, it's only in Windows 7 that it seems to be an issue (not sure if it's just me or all Win 7 installations.) I've done a search in RegSeeker and seems all of my target keys are located in HKLM... :)Thanks for your help, I'll keep digging.
     
  11. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    OK, well keep us posted, I for one would be interested in hearing how you make out.
    As a semi-interesting aside and for future reference
    C:\Windows\System32\regedt32.exe really doesn't do anything anymore except call
    C:\Windows\regedit.exe
    SOURCE: How to set or change registry editing permissions in Windows XP or in Windows Server 2003

    Regards
    Randy
     
  12. hasek747

    hasek747 New Member

    Joined:
    Jun 22, 2011
    Messages:
    20
    Likes Received:
    0
    Good to know, thanks a lot.To be honest I have no idea where to look for solutions anymore, I'd love to just nuke these keys somehow :)I'll let you know if I find a solution.
     
  13. Saltgrass

    Saltgrass Excellent Member
    Microsoft Community Contributor

    Joined:
    Oct 16, 2009
    Messages:
    15,157
    Likes Received:
    393
    As an alternative, how about using this Microsoft site to set Device Manager to show all devices, even ones that have been removed, and possibly delete them this way.

    If that doesn't work, have you tried exporting the portion of the registry you want to change, change it, then import the new version.
     

Share This Page

Loading...