If you are trying to delete keys and other things from the Registry on Windows 11 but can't because you keep getting the "Cannot delete [key name]: Error while deleting key." This happens when Windows prevents the deletion due to permission restrictions. The affected keys are often protected by the system or owned by special accounts like TrustedInstaller, making them inaccessible to standard users, even those with administrative rights. Thankfully, you can fix this problem by taking ownership of the key and granting your account the appropriate permissions. This guide walks you through that process step by step.
Takeaways:
- How do you delete a Registry key that doesn't let you delete it on Windows 11?
- Fixing: Cannot Delete Registry Key Error while deleting keys in the Windows Registry
Table of Contents
Why This Happens
When you attempt to delete a registry key, Windows checks the Discretionary Access Control List (DACL) to verify whether your account has permission to perform the action. If it doesn't, the operation fails. You must first take ownership of the key and then explicitly allow Full Control access for your user account.
How to Fix Cannot Delete Registry Key Error while deleting keys in the Windows Registry
Important: Editing the registry can cause serious system problems if done incorrectly. Always back up your registry before making changes, and only modify keys you fully understand. Be extremely careful when working in the Windows Registry. Deleting or modifying the wrong key can cause system instability or prevent your computer from starting. Only make changes when you're confident in what you're doing, and always keep a backup on hand.
- Click the Start button, type Registry Editor, right-click the result, and choose Run as administrator.
- Locate the key you want to delete in the Registry Editor.
- Right-click the key and select Permissions.

- In the Permissions window, click Advanced.
- Click the Change link next to the current owner’s name.
- Enter your Windows username and click Check Names to validate it.
- If you’re unsure of the username, click Advanced, then Find Now to list all accounts. Select your account and click OK.
- Replace owner on subcontainers and objects
- Replace all child object permission entries with inheritable permissions from this object
- Confirm your username is listed in the object name field, then click OK.

- In the Advanced Security Settings window, check:
- Click Apply, then OK. Confirm changes if prompted.
- In the Permissions window, select your user account.
- Under Permissions for [your username], check Allow next to Full Control.
- Click Apply, then OK.
- Now that you have ownership and full permissions, right-click the key again and select Delete.
If the error doesn't go away, even after taking ownership, or if you're dealing with deeply protected system keys, consider using a third-party tool or booting into Safe Mode for further troubleshooting.