Registry is the home of all Windows 10 settings. Many features that are not possible to change, enable, disable using the Windows UI can be done by editing the registry keys. There are many scenarios when you will need to manually delete a registry key. Normally, if your user account is not restricted to do so, you should be able to do it.
However, some users are getting an error while deleting key in Registry. Here I have discussed what you can do when you cannot delete registry key.
Why Registry Key Doesn’t Delete?
Contents
There can be various reasons why your Registry key is not deleting. Here are some of the potential causes:
- The User account doesn’t have required permissions: The most common reason for not being able to delete registry keys is not having the required permissions for doing it.
- The Registry key contains embedded null characters: If the key contains an embedded null character, you won’t be able to delete it with normal methods.
What To Do When You Get Error While Deleting Key From Registry?
Here I have mentioned various methods for deleting a registry key that triggered this error. Follow all the methods given here and you should be able to delete the registry key.
Solution 1: Start Registry Editor With Administrative Privileges
The first thing you can do is run the Registry Editor with administrative privileges and then try deleting the Registry key. Make sure you create a backup first.
To run the registry editor with administrative privileges, follow the steps given below:
- Press the Windows + R keys to open the Run utility.
- Type regedit and press Ctrl + Shift + Enter to open the Registry Editor with administrative privileges.
- Confirm the UAC prompt.
- Navigate to the key and try deleting it.
Now you should be able to delete the registry key. If you still can’t delete registry key, try the next solution.
Solution 2: Change The Permissions Of The Registry Key
If running the Registry editor as administrator doesn’t fix this issue, try changing the permissions of the registry key. You will need to give the user account you are using the permission to delete this key. To do it, follow the steps given below:
- Open the Registry Editor as Administrator, as mentioned earlier.
- Navigate to the registry key you want to delete and right-click on it.
- Click on the Permissions option from the right-click context menu. The permissions window will open on your screen.
- Select the Advanced option to open the Advanced Permissions window.
- Next to the Owner, click on the Change option.
- In the Enter the Object name to select section, type the Username of the account you are using and select the Check Names option to confirm it.
- Click on OK to save the changes.
- Select your username in the Permissions for section and check the Allow box next to the Full Control option.
- Click on Apply and OK to save the changes.
- Now, try to delete the registry key.
Solution 3: Run RegDelNull Tool
It is possible that the registry key you are trying to delete has an embedded null character. This can happen when you install a corrupted application. The null characters are not visible when you are looking at the registry entry. The only way you can delete a key with an embedded null character is by replacing the null character with other characters.
To do it, you can use the RegDelNull tool. Download this tool from here and extract it on your desktop. Now, follow the steps given below:
- Press the Windows + R keys to open the Run utility.
- Type cmd and press Ctrl + Shift + Enter to open an elevated Command Prompt.
- Enter the following commands and press Enter after finishing each one to delete the registry key:
1) cd desktop
2) REGDELNULL64 HKLM -S
3) REGDELNULL64 HKU -S - After the tool scans for any registry key with null characters, it will ask you whether you want to delete it. If this happens, enter the key for the Yes as instructed.
- If there are no null characters in any registry keys, then it will only show scan completed.
Solution 4: Use Other Tools For Deleting Registry Keys
If the above solutions don’t work, you can try using 3rd party tools for deleting the troublesome registry key. There are many such tools available, however, be cautious before using them and do a thorough background check.
Wrapping Up
So, there you have it. Now you know how to fix the error while deleting key. Hopefully, this issue will be fixed for you after following the above methods. If you have any questions regarding this topic, ask them in the comment section below.
Leave a Reply