REGISTRY_ERROR, the blue screen, explained and fixed

This stop code (0x00000051) means a registry operation failed at the storage level: Windows tried to read or write one of the registry hive files and the I/O failed, or the hive itself is corrupt. The registry is loaded before almost everything, so this crash typically appears at boot. The causes, in order, are a corrupt hive (often from power loss or a crash during a registry write), a failing drive, and bad RAM corrupting data on its way to disk.

The fix, in order

  1. Use System Restore from the recovery menu. Let the PC fail to boot twice and the recovery menu appears: Troubleshoot → Advanced options → System Restore. Restore points include registry snapshots, and rolling back to a point before the crashes is the cleanest fix for a corrupt hive.
  2. Run chkdsk from the recovery Command Prompt. Troubleshoot → Advanced options → Command Prompt, then chkdsk C: /f (confirm the drive letter shown there, it can differ in the recovery environment). Hive files cannot be sound on an unsound file system.
  3. Run SFC offline. In the same Command Prompt: sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows, adjusting letters if needed. This replaces damaged system files, including registry support components.
  4. Check the drive’s health. A drive developing bad sectors corrupts hive files exactly like this. Read its SMART status with the maker’s tool; if the drive is failing, no registry repair will hold, replace the drive.
  5. Test the RAM. From the recovery menu or a bootable diagnostic, run memory tests. RAM that corrupts writes will keep damaging the registry after every repair.
  6. Undo a recent registry “cleanup.” If a registry cleaner or tuning tool ran shortly before this started, its restore or undo feature (or System Restore above) is the way back. Registry cleaners cause this class of damage and fix nothing of value.
Do not copy hive files from another PC, and do not expect the old RegBack trick to save you. Hives are machine-specific, and since Windows 10 version 1803 the automatic registry backup in the RegBack folder is empty by default. System Restore points are the supported road back.

If it still happens

If no restore point exists and the drive and RAM are healthy, an in-place repair install (setup.exe from Windows installation media, choosing “Keep personal files and apps”) rebuilds the registry and system together. If the drive’s health is failing, migrate to a new drive first; every repair written to a dying disk is temporary.

Common questions

Can REGISTRY_ERROR be fixed without reinstalling Windows? Usually, yes. A System Restore point restores working hive snapshots and solves most cases in minutes. The exception is a physically failing drive, where the registry is a victim rather than the disease, and the drive has to be replaced before anything else will hold.

What corrupts the registry in the first place? Power loss or a crash in the middle of a registry write is the classic cause, followed by bad sectors swallowing part of a hive and faulty RAM flipping bits in data being written. Registry cleaner tools are a self-inflicted fourth cause. Windows writes the registry constantly, which is why storage health shows up here first.

Related errors

INACCESSIBLE_BOOT_DEVICE · Error 0xc000021a · CRITICAL_PROCESS_DIED · NTFS_FILE_SYSTEM