In this MiniTool post, we will introduce the main reasons for Error while deleting key if you cannot delete a key from the registry. We will also introduce some effective solutions that are worth trying to remove this error.

Cannot Delete Key: Error While Deleting Key

Deleting a key from the Windows Registry is a straightforward process, but sometimes, it can result in an error. The Error While Deleting Key message is one such error that can occur while trying to delete a key from the registry. This error message can be frustrating, especially when you need to remove a key for troubleshooting or uninstallation purposes.

When this error occurs, the following Error Deleting Key window will pop up. This error can happen on Windows 11, Windows 10, Windows 8, and Windows 7.

error deleting key

How to delete undeletable registry keys? In this article, we will discuss why this error occurs and how to fix it using different methods.

Why Does Error While Deleting Key Occur?

The error message Error While Deleting Key occurs when you try to delete a key from the Windows Registry, but the system is unable to complete the operation. There are various reasons why this error message can occur:

Insufficient Permissions

The most common reason for this error message is that the user doesn’t have sufficient permissions to delete the key. In Windows, the Registry is a critical system component, and only users with administrative privileges can make changes to it. If you don’t have the necessary permissions, you’ll get an error message when trying to delete a key.

The Key Is Currently in Use

Another reason why this error message can appear is that the key you’re trying to delete is currently in use. This can happen if a process or application is accessing the key or one of its subkeys. If this is the case, you’ll need to close the application or process before you can delete the key.

Corrupted Registry

Sometimes, the error message can appear due to a corrupted registry. This can happen if there’s a problem with the Windows Registry, such as missing or corrupted files, or if there’s a virus or malware on your system.

How to Fix the Error While Deleting Key?

Here are some solutions to remove the Error While Deleting Key message:

Solution 1: Restart Your Computer

The first solution you can try is to restart your computer. Sometimes, the registry key may be in use by a running process, and restarting your computer may release the key and allow you to delete it. To restart your computer, click on the Start button and select the Restart option.

Solution 2: Run Registry Editor as an Administrator

Another reason why you may encounter the Error while deleting key message is that you do not have sufficient permissions to delete the registry key. To resolve this issue, you can try running Registry Editor as an administrator. Here’s how:

Step 1: Click the search icon from the taskbar, then search for registry editor.

Step 2: Registry Editor will be the top result. Then, you need to click Run as administrator to run Registry Editor as administrator.

click Run as administrator

Step 3: If you see the User Account Control interface, you need to click the Yes button to continue.

Step 4: Try the delete that key again.

If this method doesn’t work for you, you can try the next solution.

How Can You Run Command Prompt as Administrator on Windows?
How Can You Run Command Prompt as Administrator on Windows?

Do you know how to run CMD as administrator on Windows 10? Now, you can read this post which introduces three simple methods to do this work.

Read More

Solution 3: Take Ownership of the Key

To delete a key from the Windows Registry, you need to have ownership of the key. Sometimes, the error message can appear because you don’t have ownership of the key. Here’s how to take ownership of the key:

Step 1: Right-click on the key you want to delete and select Permissions.

Step 2: Click on the Advanced button.

Step 3: Click Change next to Owner.

Step 4: Enter your username under Enter the object name to select.

Step 5: Click the Check Names button.

Step 6: Click OK to save the change.

change owner for the target key

Step 7: When you go back to the Advanced Security Settings interface, you need to click Apply and OK to save the change.

Step 8: When you go back to the Permission page, you need to click your username under Group or user names. Then, check Allow for the Full Control under Permissions for ALL APPLICATION PACKAGES.

Step 9: Click Apply and OK to save the change.

How to Change Registered Owner and Organization Information?
How to Change Registered Owner and Organization Information?

Windows 10 does not allow users to set their registered owner and organization information by themselves any more. This post shows you how to change.

Read More

Solution 4: Use PSExec to Force Delete Registry Key CMD

You can also choose to force delete registry key using CMD.

Step 1: Download PSExec from Microsoft and install it on your PC.

Step 2: Search for cmd using Windows Search, then select Run as administrator from the right panel.

Step 3: Run psexec -i -d -s c:\windows\regedit.exe in Command Prompt. This will open Registry Editor. At the same time, you need to make sure that you don’t have any prior window of Regedit open.

Step 4: Try to delete that key again.

Those are the methods to remove cannot delete key: error while deleting key while you are trying to delete a key from Registry Editor. You should find a suitable method here.

In addition, if you want to perform a data recovery on a Windows computer, you can try MiniTool Power Data Recovery. This is a professional data recovery software that can recover files from hard drives, SSDs, memory cards, pendrives, USB flash drives, and more.

MiniTool Power Data Recovery FreeClick to Download100%Clean & Safe

  • linkedin
  • reddit