Fix ERROR_PREDEFINED_HANDLE (0x000002CA) in Windows Registry
This error pops up when a program tries to use a registry key that's already locked by a predefined handle. The fix is usually restarting the app or service.
You're working on a Windows 10 or 11 machine, maybe installing an older program like Visual Studio 2010 or a legacy game, and suddenly you get a pop-up: ERROR_PREDEFINED_HANDLE (0x000002CA). The exact message reads: "The specified registry key is referenced by a predefined handle." It usually happens when the installer tries to write to a registry key that's already opened by the system or another process — like HKEY_CLASSES_ROOT or HKEY_CURRENT_USER — and that key is locked down by a predefined handle (a handle the OS reserves during boot).
What's really going on?
Windows keeps certain registry handles open from startup. These are called "predefined handles" — they're shortcuts to important branches like HKEY_LOCAL_MACHINE\SOFTWARE or HKEY_CLASSES_ROOT. When a program tries to access the same key through a different path, Windows gets confused. It sees the key is already referenced by that predefined handle and says "nope, you can't touch this." It's not a permissions issue in the normal sense—the key itself isn't corrupted. The problem is that the program is using the wrong method to open it.
The fix: step by step
Skip the complicated registry permission hacks you see on forums. The real fix is simpler than that.
- Close the program throwing the error. If it's an installer, cancel it. Don't restart yet.
- Open Task Manager. Press Ctrl+Shift+Esc. Click "More details" if you only see a short list.
- Look for anything tied to the program. Under the "Processes" tab, find any instance of the installer or app. Right-click it and select "End task."
- Restart the Windows Explorer process. This releases most predefined handles. In Task Manager, go to the "Details" tab. Find
explorer.exe, right-click it, and choose "End task." Your taskbar and desktop will disappear. Don't panic. - Restart Explorer. In Task Manager, click "File" > "Run new task." Type
explorer.exeand hit Enter. Your desktop comes back. - Try the install or operation again. Run the program as administrator. Right-click the installer and select "Run as administrator."
If it still fails
Sometimes the predefined handle is held by a service, not Explorer. Here's what to check.
- Check for stuck services. Open Services (Win+R, type
services.msc). Look for anything related to the program — like "Windows Installer" if it's an MSI package. Right-click and select "Restart." - Use Process Explorer from Sysinternals. Download it from Microsoft. Run it, hit Ctrl+F, and search for a key name from the error (like "SOFTWARE\Microsoft"). It'll show you which process holds that handle. End that process.
- Full reboot. If nothing else works, a clean restart clears all predefined handles. Hold Shift while clicking "Restart" to force a full shutdown first.
When to walk away
If you keep seeing 0x000002CA with a specific program on multiple machines, the program itself is buggy. I've seen this with old Visual Studio installers and some HP printer drivers. In that case, skip that version and find a newer one — or use a compatibility shim by right-clicking the installer, going to Properties > Compatibility, and trying Windows 7 or Windows XP SP3 mode.
This error is rare but annoying. Most of the time, restarting Explorer clears the roadblock because that's where the dead handle sits. If you're deep in development and hitting this in your own code, you're opening registry keys with RegOpenKeyEx when you should be using RegCreateKeyEx with the proper access flags. But for regular users, the steps above will get you past it.
Was this solution helpful?