If you’re encountering the error message An error is preventing this key from being opened while opening specific keys in Registry Editor on your Windows computer, then this post is intended to help you with the solutions that we will present that you can try to help you remediate this issue.
Depending on the registry key you’re trying to open, you’ll receive the following full error message:
Error Opening Key
Key cannot be opened
An error is preventing this key from being opened.
Details: The system cannot find the file specified.
You’ll encounter this issue if you searched for a registry key/location/data whose name is too long that the tool can’t handle it. And also when your account does not have the required permissions to open/modify/delete a specific registry key.
An error is preventing this key from being opened
If this error is the case of the search for registry key/location/data whose name is too long that regedit can’t handle the search query, you can try splitting your search query. If you have the complete Registry location available, you can access it manually, key by key.
However, if it’s the case that your account does not have the required permissions to open/modify/delete a specific registry key, you need to run regedit as SYSTEM account rather than an administrator account (default).
This can be done using a command-line tool named PsExec. Here’s how:
First, download PsExec tool by Sysinternals from TechNet.
Extract the downloaded compressed zipped file.
Upon extracting the file, you’ll get the PSTools folder. Copy all the content inside this folder to the directory path below. Replace C: with your system root drive.
C:\Windows\System32 folder
Now, open Command Prompt in admin mode.
In the CMD prompt window, copy and paste the command below and hit Enter.
psexec -i -d -s c:\windows\regedit.exe
This command will launch Registry Editor with the system account.
You can try the search query again.
It should complete successfully without the issue.
That’s it!
Related: Error while deleting key in Registry
How do I fix error access to the registry?
If you cannot access Registry Editor, press Win+R, type gpedit.msc and hit the Enter button. Navigate to this path: User Configuration > Administrative Templates > System. Double-click on the Prevent access to registry editing tools setting and choose the Not Configured option. Click the OK button.
How do I remove a corrupt registry key?
To remove a corrupt registry key, you need to scan and recognize the key first. If the key is important, you need to use the System Restore point to get it back if you don’t have a backup. However, if you want to delete it, right-click on the key, select Delete, and click the Yes button.
Read: How to fix or repair corrupted or damaged Registry in Windows.