If you’re stuck with a corrupt BCD error on Windows, the fix is to repair the Boot Configuration Data using the Windows Recovery Environment’s Command Prompt. This article walks you through the exact commands to run, what causes the error, and how to prevent it from happening again.
What Is the BCD and Why Does It Matter?
The Boot Configuration Data (BCD) is a small database that Windows uses to start up. It contains boot parameters, such as which operating system to load, where its files are located, and how to handle boot options like Safe Mode. When the BCD is missing, corrupted, or misconfigured, Windows cannot find the instructions it needs to boot, and you’ll see an error like “The Boot Configuration Data for your PC is missing or contains errors” or “File: \Boot\BCD Status: 0xc000000f”.
This error can happen on any Windows version from 7 through 11, and it often appears suddenly after a power outage, a failed update, or a disk partitioning mistake. The good news is that, in most cases, the BCD can be rebuilt without reinstalling Windows.
Before You Start: What You Need
To repair the BCD, you need to boot into the Windows Recovery Environment (WinRE). Here’s how to get there, depending on your situation:
- If Windows starts but fails: After two failed boot attempts, Windows should automatically launch the recovery screen. If not, power off and on your PC repeatedly (3 times) to trigger it.
- If you have a Windows installation USB or DVD: Insert it, boot from it, and select Repair your computer on the setup screen.
- If you have a recovery drive: Plug it in and boot from it, then choose Troubleshoot.
Once you’re in the recovery environment, go to Troubleshoot > Advanced options > Command Prompt. This opens a command-line window where you’ll run the repair commands.
How to Repair the BCD (Step-by-Step)
At the Command Prompt, you’ll use three built-in tools: bootrec, diskpart, and bcdedit. Here’s the safest order to run them:
- Run
bootrec /fixmbr– This rewrites the master boot record without touching your data. It fixes issues where the MBR is damaged but the BCD itself is fine. - Run
bootrec /fixboot– This writes a new boot sector to the system partition. If you get an “Access is denied” error, skip to step 4. - Run
bootrec /rebuildbcd– This scans for Windows installations and asks if you want to add them to the BCD. TypeY(orAfor all) when prompted. - If the above fails, use
diskpartto manually reassign the system partition:- Type
diskpartand press Enter. - Type
list diskto see your drives. - Type
select disk 0(replace 0 with your Windows drive if it’s different). - Type
list volumeto see partitions. - Identify the partition labeled System (usually 100 MB or 260 MB, FAT32). Note its volume number.
- Type
select volume N(replace N with the number). - Type
assign letter=Sto give it a drive letter. - Type
exitto leave diskpart.
- Type
- Then run
bcdboot C:\Windows /s S: /f ALL– This rebuilds the BCD store on the system partition (S:) using the Windows files on your C: drive. If your Windows partition isn’t C:, change it accordingly (you can check withdir C:\Windows). - Restart your PC and see if Windows boots normally.
If you still get the error, you can also try bootrec /scanos to check if Windows is detected, and then manually add it with bcdedit /create {ntldr} /d "Windows" (though this is rarely needed).
Common Causes and How to Avoid Them
Understanding why the BCD gets corrupted can help you prevent a recurrence. The most frequent culprits are:
- Power outages or hard shutdowns: If the system loses power while writing boot data, the BCD can become incomplete. Using a UPS or properly shutting down can help.
- Failed Windows updates: A botched update can leave the BCD in an inconsistent state. Keeping your system updated and having a restore point can mitigate this.
- Disk partitioning errors: Using third-party partition tools or shrinking the system partition incorrectly can damage the BCD. Always back up before resizing partitions.
- Malware or antivirus interference: Some malware targets boot records. Running a full scan with Windows Defender or a reputable tool after repair is wise.
What If the Repair Commands Don’t Work?
If the BCD repair fails, the problem may be deeper. Here are a few things to try:
- Check for disk errors: Run
chkdsk C: /ffrom the Command Prompt to find and fix file system issues. - Reset the BIOS/UEFI settings: Sometimes a BIOS misconfiguration (like a wrong boot order or disabled UEFI) can mimic a BCD error. Enter BIOS (usually by pressing F2, F10, or Del during startup) and ensure your boot drive is first.
- Use System Restore: If you have a restore point from before the error, you can try System Restore from the Advanced Options menu.
- Reinstall Windows: As a last resort, you can reinstall Windows while keeping your personal files (choose “Keep personal files and apps” during setup). This is more invasive but often resolves persistent boot issues.
Differences Between MBR and GPT (UEFI) Systems
The repair steps above work for both legacy BIOS (MBR) and UEFI (GPT) systems, but there are subtle differences. On UEFI systems, the boot files live on a separate EFI System Partition (ESP) formatted as FAT32, and the BCD is stored there. On legacy systems, the boot files are on the active primary partition, often on the same drive as Windows.
If you’re on a UEFI system, the diskpart step is almost always necessary because the ESP may not have a drive letter. Also, when using bcdboot, the /f ALL flag ensures both UEFI and legacy boot files are copied, which is safe for either type.
Frequently Asked Questions
Will repairing the BCD delete my files?
No. The bootrec and bcdboot commands only rewrite boot configuration data and boot sectors. They do not touch your personal files, installed programs, or the Windows folder. However, if you use diskpart incorrectly (like selecting the wrong volume), you could cause data loss, so double-check the volume numbers.
Why do I get “Access is denied” when running bootrec /fixboot?
This usually happens on UEFI systems because the boot sector isn’t writable from the recovery environment. The solution is to skip /fixboot and proceed directly to the diskpart + bcdboot method, which rebuilds the BCD from scratch.
Can I fix the BCD from a Linux live USB?
Yes, but it’s more complicated. You’d need to mount the Windows partition and the ESP, then use tools like ntfs-3g and efibootmgr to recreate the boot entries. For most users, using the Windows Recovery Environment is simpler and safer.
How long does the repair take?
The commands themselves take only a few minutes. The entire process, including booting into recovery and running all steps, typically takes 10–20 minutes. If you need to run chkdsk on a large drive, it can take longer.
Is there a way to prevent BCD corruption?
Yes. Always shut down Windows properly, keep your system updated, and avoid using third-party partition tools on the system drive. Creating a system restore point before major updates or disk changes is also a good habit.
What if I don’t have a Windows installation USB?
You can create one on another computer using Microsoft’s Media Creation Tool (free from Microsoft’s website). If you have no access to another PC, you can try forcing the recovery screen by interrupting boot three times, but this doesn’t always work.
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
- Google Docs Dark Mode: How to Enable It
- Snapchat Cameos Not Showing Up? Fix It Fast
- Fix Blurry Apps After Changing Display Scaling in Windows 11
- iOS 14 Widgets on Android: How to Get Them
- How to Create WhatsApp Community Events
- System Restore Not Working in Windows 10? Fix It