0XC0000218: Registry Hive Won't Load After Bad Shutdown or Disk Error
Windows can't boot because the registry hive file is corrupt or missing. This usually happens after a power loss or a failed update. You'll see a black screen with the error code and a file name like System32\config\software.
You hit the power button, Windows starts loading, then stops. Black screen. The error says 0XC0000218 and something like {Registry File Failure} The registry cannot load the hive (file): \SystemRoot\System32\config\software. This is a real panic moment. I've seen this after a sudden power outage, a forced shutdown when Windows was writing registry changes, or a disk that's starting to develop bad sectors. The error tells you one thing: Windows can't read the registry hive file it needs to keep running.
What Actually Happens
The registry is split into several files called hives. The main ones are SYSTEM, SOFTWARE, SAM, SECURITY, and DEFAULT. They live in C:\Windows\System32\config\. Each hive has a matching .log file and sometimes an .alt file. When Windows writes to a hive, it logs the changes in the log file first. If the write fails — say, because the power went out — the hive and the log can get out of sync. Windows then refuses to load that hive. The error tells you exactly which file is broken. In most cases it's software or system.
What You Need
- A Windows installation USB or DVD (same version — Windows 10 or 11).
- Another working computer to create that USB if you don't have one.
- Patience. This fix takes time but works.
Step-by-Step Fix
Step 1: Boot into Windows Recovery Environment
- Insert your Windows installation USB and restart the computer.
- Press any key when prompted to boot from the USB.
- When the blue Windows Setup screen appears, click Next.
- Click Repair your computer in the bottom-left corner. You'll see three options. Choose Troubleshoot then Advanced options then Command Prompt.
Step 2: Find the Correct Drive Letter
The drive letters in the recovery environment are often different from what you see in Windows. Your C: drive might be D: or E:. Type diskpart and press Enter. Then type list volume. Look for the volume with the label that matches your Windows drive — usually something like OS or Windows. The drive letter shown is the one you'll use. I'll call it X: in the examples. Type exit to leave diskpart.
Step 3: Check the Registry Files
Type this, but replace X: with your actual drive letter:
dir X:\Windows\System32\config
You should see a list of files. Look for any file that ends in .bak — Windows sometimes keeps a backup. Also look for the hive that the error mentioned. If the file is missing or zero bytes, that's your problem.
Step 4: Try the Registry Backup (if it exists)
Windows 10 and 11 automatically save a copy of the registry hives in X:\Windows\System32\config\RegBack. Type:
dir X:\Windows\System32\config\RegBack
If you see files like SOFTWARE and SYSTEM in there that are not zero bytes, you can restore them. Copy each broken hive from RegBack to the config folder. For example, if the error was about software, do:
copy X:\Windows\System32\config\RegBack\SOFTWARE X:\Windows\System32\config\SOFTWARE
You'll get a prompt asking if you want to overwrite. Type Yes and press Enter. Repeat for SYSTEM, SAM, SECURITY, and DEFAULT if they exist in RegBack.
Step 5: If No Backup — Use the Log or Alternate File
Sometimes the log file is intact and Windows can merge it. This is where the .log and .alt files come in. In the command prompt, type:
chkdsk X: /f
Let that run. It fixes disk errors and sometimes repairs the log relationship. After CHKDSK finishes, try this to force Windows to use the alternate file:
rename X:\Windows\System32\config\SOFTWARE SOFTWARE.corrupt
rename X:\Windows\System32\config\SOFTWARE.alt SOFTWARE
This renames the broken hive and promotes the alternate copy. Works only if the .alt file exists and is healthy.
Step 6: Last Resort — Restore from System Restore Point
If you have System Protection enabled, you can roll back the registry. Back in the Advanced options menu, choose System Restore. Pick a restore point from before the error started. This replaces the registry files with a snapshot. It won't touch your personal files.
If It Still Fails
If none of the above works, the hive file is too damaged. You're looking at a repair install or a clean install. A repair install keeps your apps and files but replaces Windows system files. Boot from the USB, choose Install now, then when it asks for the edition, pick the same one you have. After the license screen, select Upgrade: Install Windows and keep personal files and apps. That's your last shot without losing everything.
Also, if you suspect disk failure — and you should if you get this error more than once — run a full disk check from the recovery command prompt: chkdsk X: /r. That scans for bad sectors and can take hours. Let it finish. Then try the registry fixes again.
One more thing: don't ignore the disk. If this error came from a failing drive, even a successful repair will fail again. Back up your data as soon as you can.
Was this solution helpful?