SOLVED: ‘Error while deleting key’ on Windows 10

Matthew Adams By: Matthew Adams
3 minute read
error deleting key windows 10

For various PC problems, we recommend this tool.

This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues now in 3 easy steps:

  1. Download this PC Repair Tool rated "Excellent" on TrustPilot.com.
  2. Click “Start Scan” to find Windows issues that could be causing PC problems.
  3. Click “Repair All” to fix all issues with Patented Technologies (requires upgrade).

Deleting registry keys isn’t something you should usually do. However, sometimes deleting a registry key might fix a system error. Yet, this error message might occasionally pop up when you select to delete a locked registry key: “Cannot delete key: Error while deleting key.” This is how you can fix the “error while deleting key” error in Windows 10 to erase locked registry entries.

Fix ‘Error while deleting key’ in the Registry Editor

  1. Open the Registry Editor as Administrator
  2. Edit the Registry Key’s Permissions
  3. Add RegDelNull to Windows
  4. Delete the Key With Registry DeleteEx
  5. Registrar Registry Manager to Windows

1. Open the Registry Editor as Administrator

First, note that you might need to open the Registry Editor with admin rights to erase certain keys. To do that, press the Cortana button on the taskbar. Then enter the keyword ‘regedit’ in the search box, right-click regedit and select Run as administrator.

2. Edit the Registry Key’s Permissions

  • Editing a registry key’s permissions will usually fix the “Cannot delete key” issue. To do that, first open the Registry Editor as administrator as outlined above.
  • Right-click the registry key you need to delete and select Permissions to open the window shown directly below.

  • Press the Advanced button to open the window in the shot directly below.

  • Click the Change link at the top of the window.
  • Enter your own username in the Enter object name text box shown directly below.

  • Press the Check Names button on the Select User or Group window.
  • Press the OK button on the Select User or Group window.
  • Select your username on the Permissions for… window.
  • Select the Full Control’s Allow check box.
  • Then press the Apply and OK buttons to close the window.

ALSO READ: Fix: ESC key not working in Windows 10


For various PC problems, we recommend this tool.

This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues now in 3 easy steps:

  1. Download this PC Repair Tool rated "Excellent" on TrustPilot.com.
  2. Click “Start Scan” to find Windows issues that could be causing PC problems.
  3. Click “Repair All” to fix all issues with Patented Technologies (requires upgrade).

3. Add RegDelNull to Windows

RegDelNull is a command-line utility program with which you can delete registry keys that otherwise return the “Cannot delete key” error message. You can save the program’s ZIP file to Windows by clicking Download RegDelNull on this website page. Open the program’s ZIP archive in File Explorer, press the Extract all button and select a folder path to extract it to. Click the program’s exe in the extracted folder, and open the Command Prompt. Then you can delete registry keys by entering this command: regdelnull <key path> -s.

4. Delete the Key With Registry DeleteEx

DeleteEx is an alternative program with a GUI that you can erase locked registry entries with. Press the Download Now button on this website page to add DeleteEx to Windows. When you have the software open, you can enter the path of the registry entry to delete in a text box on the Delete Key tab. Furthermore, you can also select to erase all the key’s subkeys. As this software includes more settings, DeleteEx might be a better program to delete registry entries with than RegDelNull.

5. Add Registrar Registry Manager to Windows

The Registrar Registry Manager is an alternative third-party registry editor for Windows. With that you can delete registry keys that you would otherwise need to adjust permissions for as outlined above. The software also includes additional search, CLSID lookup and registry compare tools. You can add that software to Windows 10 by clicking Advanced Registry Manager on this webpage. Then you can delete the required registry key in Registrar much the same as in the Registry Editor.

So you can fix the “Cannot delete key” error in Windows by adjusting the key’s permissions or by utilizing the Registrar, DeleteEx or RegDelNull software. However, remember to back up the registry before erasing the locked registry keys. Alternatively, you can set up a restore point to roll Windows back to as covered in this post.

RELATED STORIES TO CHECK OUT:

For various PC problems, we recommend this tool.

This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues now in 3 easy steps:

  1. Download this PC Repair Tool rated "Excellent" on TrustPilot.com.
  2. Click “Start Scan” to find Windows issues that could be causing PC problems.
  3. Click “Repair All” to fix all issues with Patented Technologies (requires upgrade).

Discussions

Next up

Mysterious update KB4023057 got released again: What it is for?

Giles Ensor avatar. By: Giles Ensor
3 minute read

Here is an interesting situation. Microsoft releases update KB4023057 (again), still doesn’t explain what it is for, and expects everyone to be happy. Result? Well, […]

Continue Reading

Dutch Regulators catch Windows 10 breaching GDPR

Giles Ensor avatar. By: Giles Ensor
3 minute read

Two years in the offing and GDPR is still being breached. It will come as no surprise to many that a big, American tech company […]

Continue Reading

Microsoft was just playing with Mail ads and turned them off

Giles Ensor avatar. By: Giles Ensor
3 minute read

The symbiosis of the internet and advertising has long been understood. Everyone understands that if you have access to something that is ‘free’, inasmuch as […]

Continue Reading