sodcalculator

10 Tech How-To

Fix Windows Stop Code 0xc000021 (Step-by-Step)

Guide 10-53601 · Updated · Step by step

Windows stop code 0xc000021 (often written 0xC000021A) is a blue screen error that appears when a critical system process, usually the Winlogon or Client Server Runtime Subsystem (csrss.exe), fails to start or crashes. This guide walks you through the most reliable fixes, from automatic startup repair to manual registry edits, so you can get back into Windows without reinstalling.

What You’ll Need

  • Access to Windows Recovery Environment (WinRE) — usually automatic after two failed boots
  • A Windows installation USB or recovery drive (if WinRE doesn’t load)
  • Another working computer (only if you need to create a USB drive)
  • Your Windows product key (not always required, but helpful if reinstalling)
  • Patience — some steps involve command line tools

Step-by-Step

Step 1: Boot into Windows Recovery Environment

  1. Turn the PC off completely by holding the power button for 5–10 seconds.
  2. Turn it back on. As soon as the Windows logo appears, hold the power button again to force a shutdown.
  3. Repeat this forced shutdown process two to three times. On the next boot, Windows should display “Preparing Automatic Repair” and then load the blue recovery screen.
  4. If it doesn’t, insert your Windows installation USB, restart, and press the key to open the boot menu (usually F12, F11, or Esc, depending on your motherboard). Select the USB drive, then choose “Repair your computer” on the first setup screen.

Step 2: Run Startup Repair

  1. In the Recovery Environment, click Troubleshoot.
  2. Click Advanced options.
  3. Click Startup Repair.
  4. Select your operating system (usually Windows 10 or Windows 11). Wait for it to diagnose and attempt a fix. This can take 10–30 minutes.
  5. If it reports that it couldn’t fix the problem, continue to the next step.

Step 3: Check Disk and System Files

  1. From Advanced options, choose Command Prompt.
  2. Type sfc /scannow and press Enter. This checks system file integrity. It may take 15–20 minutes.
  3. After it finishes, type DISM /Online /Cleanup-Image /RestoreHealth and press Enter. This repairs the Windows image. It can take 20–40 minutes.
  4. Type chkdsk C: /f /r and press Enter. If prompted to schedule it, type Y and press Enter, then restart the PC. This checks the hard drive for bad sectors and file system errors.
  5. After these complete, type exit and restart normally.

Step 4: Disable Driver Signature Enforcement (Temporary)

  1. From Advanced options, choose Startup Settings.
  2. Click Restart.
  3. After the PC restarts, you’ll see a list of startup options. Press 7 or F7 to select “Disable driver signature enforcement.”
  4. Windows will boot with unsigned drivers allowed for that session. If you can get in, update or uninstall any recently added drivers, then restart normally.

Step 5: Restore the Registry (if you have a backup)

  1. If you previously created a System Restore point, go back to Advanced options and choose System Restore.
  2. Follow the wizard to pick a restore point from before the error started.
  3. If you don’t have a restore point, skip to Step 6.

Step 6: Manual Registry Fix (Advanced)

  1. Open Command Prompt from Advanced options.
  2. Type regedit and press Enter.
  3. In Registry Editor, click HKEY_LOCAL_MACHINE to highlight it.
  4. Click File → Load Hive.
  5. Navigate to C:\Windows\System32\config (the drive letter may be different; check with dir in Command Prompt).
  6. Select the file named SYSTEM and click Open.
  7. When prompted for a key name, type RecoveryHive and click OK.
  8. Expand HKEY_LOCAL_MACHINE → RecoveryHive → ControlSet001 → Control → Session Manager.
  9. Look for a value named PendingFileRenameOperations. If it exists, right-click it and choose Delete.
  10. Also check ControlSet002 and ControlSet003 the same way.
  11. Go back to HKEY_LOCAL_MACHINE, click RecoveryHive, then File → Unload Hive.
  12. Close Registry Editor, type exit, and restart.

Step 7: Perform a Repair Install (In-Place Upgrade)

  1. Boot from your Windows installation USB.
  2. Choose Install now.
  3. When asked for the product key, enter it or click “I don’t have a product key” (Windows will reactivate automatically if it was previously activated).
  4. Accept the license terms, then choose Upgrade: Install Windows and keep files, settings, and applications.
  5. This reinstalls Windows while keeping your personal files. It takes 30–60 minutes.

Step 8: Clean Install (Last Resort)

  1. From the USB installer, choose Custom: Install Windows only.
  2. Select the partition where Windows is installed (usually Drive 0 Partition 1 or 2) and click Delete. Confirm the warning.
  3. Select the unallocated space and click Next. Windows will create the necessary partitions automatically.
  4. Complete the setup. This erases all data, so back up anything important first.

Common Mistakes

  • Skipping Startup Repair — it’s the easiest fix and often resolves the issue without touching the registry.
  • Running DISM before SFC — SFC should run first; DISM repairs the image that SFC relies on, but running both in order is safest.
  • Deleting the wrong registry value — only delete PendingFileRenameOperations if you’re sure it exists; don’t delete other keys in that branch.
  • Forgetting to unload the hive — if you close Registry Editor without unloading, the SYSTEM file stays locked and may cause further corruption.
  • Choosing “Custom” install when you meant “Upgrade” — Custom wipes everything. Double-check before clicking.
  • Not backing up data before a clean install — if you can still boot into Safe Mode, copy files to an external drive first.

Tips

  • Always create a System Restore point after installing new drivers or updates. It can save you hours of troubleshooting later.
  • Keep a Windows installation USB handy. You can create one on any PC using Microsoft’s Media Creation Tool.
  • If the error appears right after a Windows update, try uninstalling that update from Safe Mode (Shift + Restart from the login screen).
  • Check your disk’s health with chkdsk and also look at the S.M.A.R.T. status in BIOS — a failing drive can cause this error.
  • If you have a second PC, you can connect the affected drive as a secondary drive and run sfc /scannow /offbootdir=D:\ /offwindir=D:\Windows from the working system.

Troubleshooting

Startup Repair says it can’t fix the problem. This is common. Move to the Command Prompt steps (Step 3) and run SFC and DISM. If those fail, try the registry fix in Step 6.

You can’t boot into WinRE at all. Use a Windows installation USB. If you don’t have one, create it on another computer. If that’s not possible, you may need to use third-party recovery tools, but that’s beyond this guide’s scope.

Command Prompt says “Access is denied.” Make sure you’re running it as administrator. In WinRE, the Command Prompt is usually elevated by default, but if you’re in Windows Safe Mode, right-click and select “Run as administrator.”

DISM fails with error 0x800f081f. This means the source files are missing. Try DISM /Online /Cleanup-Image /RestoreHealth /Source:C:\Windows\WinSxS or mount your Windows ISO and use the /Source parameter pointing to the install.wim file.

The registry hive won’t load. If you get an error loading the SYSTEM file, the hive may be corrupted beyond repair. At that point, a repair install or clean install is your best option.

You still see the error after a repair install. This points to a hardware issue, most likely RAM. Run Windows Memory Diagnostic (type mdsched.exe in Run) or use Memtest86 from a USB drive. Replace faulty RAM sticks.

Frequently Asked Questions

What exactly causes error 0xc000021? It’s triggered when a critical system process like csrss.exe or winlogon.exe fails to start or crashes. Common triggers include corrupted system files, bad drivers, failed Windows updates, or registry damage.

Will I lose my files if I follow these steps? Most steps (Startup Repair, SFC, DISM, registry fix) preserve your files. Only the clean install in Step 8 erases everything. A repair install keeps files but reinstalls Windows apps.

Can I fix this without a Windows USB? Yes, if WinRE loads automatically. If it doesn’t, you’ll need a USB or recovery drive. There’s no reliable way to fix this error from outside Windows without one.

Is this error caused by a virus? Rarely, but malware can corrupt system files or registry entries that trigger this stop code. If you suspect malware, scan with Windows Defender after you regain access.

How long does each fix take? Startup Repair: 10–30 minutes. SFC and DISM: 30–60 minutes combined. Repair install: 30–60 minutes. Clean install: 20–40 minutes plus setup time.

What if the error appears in Safe Mode too? That indicates a deeper system or hardware problem. Try the registry fix and repair install. If it persists, test RAM and disk health, as failing hardware can cause this error even in Safe Mode.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →