How to Fix BCD Errors in Windows 10 and 11 (Boot BCD Repair)

Martin Brinkmann
Updated •
Windows

To fix a BCD error in Windows, boot from Windows installation media, open Command Prompt from the recovery options and run bootrec /scanos, then bootrec /rebuildbcd. If Windows is not found, back up and rename the old BCD store and rebuild it. On UEFI PCs, bcdboot rebuilds the boot files and the BCD from the installed Windows folder.

This guide covers the Boot Configuration Data (BCD) error on Windows 10 and Windows 11, what causes it, the repair commands for BIOS/MBR and UEFI/GPT systems, and what to do when the commands fail.

What is the BCD error and what causes it?

Windows recovery screen: Your PC/Device needs to be repaired, the Boot Configuration Data is missing or contains errors

A BCD error means the Boot Configuration Data store, which tells the Windows Boot Manager which operating systems exist and how to start them, is missing, damaged or points to the wrong place. The recovery screen usually names the file \Boot\BCD (BIOS systems) or \EFI\Microsoft\Boot\BCD (UEFI systems) and an error code such as 0xc000000f.

Typical messages include:

  • Your PC/Device needs to be repaired. The Boot Configuration Data for your PC is missing or contains errors.
  • The Boot Configuration Data file doesn't contain valid information for an operating system.
  • Windows failed to start. A recent hardware or software change might be the cause.
  • There was a problem with a device connected to your PC. An unexpected I/O error has occurred.

Common causes are an unexpected shutdown, a crash during an update, disk corruption, a failing drive, a changed boot order or disk layout, and malware. Windows has stored boot data in the BCD since Windows Vista, where it replaced boot.ini. Because the PC cannot start Windows, graphical tools such as the Visual BCD Editor cannot help until the PC boots again.

How do you open Command Prompt from the recovery environment?

You open Command Prompt through the Windows Recovery Environment, started from installation media if the PC no longer reaches it on its own. Microsoft's media creation tool makes a bootable USB drive of at least 8 GB for Windows 11, and a similar tool exists for Windows 10. Build it on a working PC, because the drive is erased.

  1. Plug in the USB drive and open the boot menu or firmware setup (commonly Esc, Delete, F2, F10, F11 or F12, depending on the maker). Boot from the USB drive.
  2. On the first Setup screen choose language and keyboard, then click Next.
  3. Click Repair your computer, not Install now.
  4. Choose Troubleshoot, then Advanced options, then Command Prompt.

Shift+F10 on the first Setup screen also opens a Command Prompt. If the PC shows the blue recovery screen on its own, pressing the key for Advanced options leads to the same menu. Try Startup Repair from Advanced options first, since it is automatic.

Download media from Microsoft: Windows 11 or Windows 10.

Which bootrec commands repair the BCD?

The bootrec commands that repair BCD errors are bootrec /scanos and bootrec /rebuildbcd. Run them in this order from the recovery Command Prompt:

  1. bootrec /scanos scans all disks for Windows installations that the BCD does not list. Restart afterwards to see whether that solved it.
  2. bootrec /rebuildbcd scans for installations and offers to add them to the BCD store. Answer Y for each Windows installation it finds, or A for all.
  3. Type exit and restart the PC without the USB drive.

Two older switches are often listed with these. bootrec /fixmbr overwrites only the master boot code and does not repair a damaged partition table. bootrec /fixboot writes a new boot sector to the system partition. They apply mainly to BIOS/MBR PCs, and on UEFI systems /fixboot can fail with an "Access is denied" message. If that happens, continue with the next section.

What if bootrec /rebuildbcd says "Total identified Windows installations: 0"?

If bootrec /rebuildbcd finds no installations, the old BCD store is probably damaged, and Microsoft's documented fix is to back it up, clear its attributes, rename it and rebuild. Run these commands one after the other, replacing C: with the drive that holds the boot files if it differs:

  1. bcdedit /export C:\bcdbackup saves a copy of the current store.
  2. attrib C:\boot\bcd -r -s -h removes the read-only, system and hidden attributes.
  3. ren C:\boot\bcd bcd.old renames the damaged store.
  4. bootrec /rebuildbcd builds a fresh store and adds the Windows installations it finds.

Restart afterwards. In the recovery environment drive letters can differ from what you see in Windows, so run diskpart, then list volume, to find the system partition and your Windows volume. If attrib reports "path not found", you are on the wrong drive letter or on a UEFI system, where the BCD is in the EFI partition (see below).

How do you fix the BCD on a UEFI or GPT PC with bcdboot?

On a UEFI/GPT PC, bcdboot is the usual repair: it copies fresh boot files from your installed Windows folder to the EFI System Partition (ESP) and creates a new BCD store.

  1. In the recovery Command Prompt, run diskpart, then list disk. A star in the GPT column means a GPT disk, the layout used with UEFI.
  2. Run select disk 0 (use your system disk), then list partition and find the small FAT32 partition of type System (the ESP).
  3. Run select partition N (N is the ESP number), then assign letter=S, then exit.
  4. Use list volume in diskpart to find the drive letter of your Windows volume. Assume C: below.
  5. Run bcdboot C:\Windows /s S: /f UEFI.
  6. Restart. Because the /s switch makes bcdboot rely on the firmware's default boot path instead of creating a boot entry, you may need to pick the drive in the firmware boot menu or boot order if the PC does not start on its own.

The /s switch names the system partition and /f sets the firmware type: UEFI, BIOS or ALL. On a BIOS/MBR PC, bcdboot with /f BIOS writes the files to the active partition. Not sure which mode your PC uses? Windows lists it as BIOS Mode in msinfo32 (UEFI or Legacy), and the installation media's boot menu labels entries as UEFI or legacy.

What if the repair does not work?

If the repair fails, the BCD is usually not the real problem: the drive may be failing, the Windows folder may be damaged or the wrong disk may be set to boot first. Work through these checks:

  • Confirm that the firmware boot order puts the Windows drive (or Windows Boot Manager) first.
  • In the recovery Command Prompt run chkdsk C: /f to check the file system, and check the drive's SMART status from the maker's tool if the error returns.
  • If your data matters and the drive is failing, copy files off it first, for example from the recovery Command Prompt with Notepad's file dialog or from another PC. A Rescuezilla boot disk can image the drive before you try anything riskier.
  • BitLocker users may be asked for the recovery key in the recovery environment. Keep it available before changing boot files.
  • As a last resort, use Reset this PC from Advanced options, or reinstall Windows.

For related errors see Fixing the Bootmgr is missing error.

FAQ

Is the file boot\bcd a virus?

No. \Boot\BCD is the Windows Boot Configuration Data store. Malware can damage it, but a BCD error alone does not mean infection.

Will rebuilding the BCD delete my files?

No. These commands only change boot data, not your documents. Back up important data first anyway if you suspect a failing drive.

Why does bootrec /fixboot say Access is denied?

It can happen on UEFI/GPT systems, where the boot files sit on the EFI partition. Use the bcdboot method instead of repeating /fixboot.

Related: Fixing the Bootmgr is missing error, Visual BCD Editor, Rescuezilla

Comments

  1. Meir said on
    Reply

    I got access denied after doing tge commands.. Is there any solution for this?

  2. Mr Israel said on
    Reply

    Are there no shortkeys that will take you to recovery mode from booting?

  3. jh said on
    Reply

    I have used the (bootrec /fixmbr, bootrec /fixboot,bootrec /scanos, and bootrec /rebuildbcd) and it does work temporarily… BUT after about 30-60 mins my computer will restart and I have to re-do all the steps. Is there a way to fix this on my own?

  4. Anonymous said on
    Reply

    I have used the (bootrec /fixmbr, bootrec /fixboot,bootrec /scanos, and bootrec /rebuildbcd) and it does work temporarily… BUT after about 30-60 mins my computer will restart and I have to re-do all the steps. Is there a way to fix this on my own?

  5. Ige Jesufunbi said on
    Reply

    Thanks so much, it works, thanks so much

  6. Bappi Kearley said on
    Reply

    I have today had this error come up and followed the instructions booted to recovery entered command prompt, typed in bootrec /fixmbr ( operation completed successfully) typed bootrec /fixboot and ACCESS denied.

    how do i proceed there are no remedies i can find around this.

  7. Varadharajan k said on
    Reply

    Above method does not fixes when system uses UEFI mode. To fix this there is an another command

  8. Bob said on
    Reply

    bootree referenced above, not a recognizable term @ cmd

  9. jess said on
    Reply

    should I follow the step by step guide or the walk through video.
    the steps are different from my understanding.

    1. Martin Brinkmann said on
      Reply

      Try the step by step guide first!

  10. Leza said on
    Reply

    How do i unzip files on windows 7
    And iv no disk wot do i do

  11. Cigologic said on
    Reply

    The standard bootrec commands (bootrec /fixmbr, bootrec /fixboot, bootrec /rebuildbcd) can be quite effective in repairing the BCD store & allowing the PC to boot up again.

    However, I found that on Win 7, the BCD store repaired by the aforementioned commands is so barebones that the PC no longer has the ‘Advanced Boot Options’ menu with ‘Repair My Computer’ option, which was normally accessible by repeatedly pressing the F8 key after powering on the PC.

    The below site shows how to recreate the “full” BCD store from scratch using the bcdedit command:
    https://mrlithium.blogspot.com/2011/10/my-boot-configuration-data-bcd-store.html

  12. Sophie said on
    Reply

    @farmers – so many times I used to run (and did recently), and have System Restore fail on me. The scenario goes that it whirs away, and looks like its doing stuff, and then finally announces that it was not successful. Incredible how flaky I’ve found this over the years.

    Now I just use Macrium, and its never failed me. I have SR turned off, and also, SR on an SSD is not a good idea anyway.

  13. farmers said on
    Reply

    When I encounter these errors, I sometimes find that some of the bootrec commands listed here fail when run from a usb boot drive. Apparently this is normal, too. But I’ve found boot problems like this have been becoming more complicated to fix with recent versions of Windows. Even the good old System Restore function (which I know is of no help in this particular scenario) is seemingly getting phased out in Windows 10, which has a habit of turning the feature off all by itself, particularly after new build updates. MS even know about the problem, and don’t appear to think it is an issue as they say Windows 10 now has ‘better’ ways of fixing problems.

  14. ForeverOverAndOverReInstallerGuy said on
    Reply

    Then again, considering the facts that Redmond releases a new OS twice a year and with most big updates in between all your tweaked settings are reset to default, is it worth the hassle of trying to repair this and that for hours on an OS which is still essentially Beta..? I have found that it’s much easier to have all my files on a separate drive (also on external drives of coz..) and if, no WHEN, windows 10 goes belly-up I just reinstall the whole thing. But that’s just me.

    1. lehnerus2000 said on
      Reply

      I also use separate partitions for my OS, Documents, Music, Pictures & Videos.

      You should consider using Imaging Software.
      There are various Free Imaging programs available, like Macrium Reflect Free Edition (which I use).
      The Images are smaller than the original partitions but Music, Pictures & Videos don’t compress much.

      On my PC (apart from the SSD, my hardware is ~8 years old):
      – My Backup Image creation speed is ~5GB/minute.
      – It takes less than 10 minutes to create my OS Backup Image.
      – It takes ~15 minutes to restore my OS and all software.

      This is much faster than reinstalling Windows, resetting my preferences and reinstalling all of my software. :)

  15. exrelayman said on
    Reply

    A wee bit of info and advice for those like me who are NOT techies and come here because of that fact.

    Write down using pen and paper every daggone step you do when you mess with bios. Restore to a good image has no effect on bios, which is separate from windows. If what you do causes trouble, you will need that physical record to undo how you got in trouble.

    All bios are not the same. More than once I have tried to follow online bios instructions such as are in this post and found to my dismay that the part of bios I am advised to alter does not even exist in my bios. Sometimes you simply cannot make that bios change. I have tried more than once to alter the bios in my Dell windows 10 laptop and not been able to do so, or have even made the recommended change and it caused problems, when the meticulous record I kept saved my posterior.

    Dell tech says my windows 10 laptop has built into it that 3 unsuccessful boot attempts will get you the advanced recovery screen, which you normally need to access by restarting windows while holding down the shift key. I have to take this on trust since I can’t make 3 bad boot attempts happen so I can make a test. If in fact that does not happen I will have no other option but trundle over to Best Buy and pay for out of warranty service, so I sure hope it never does. But this circumstance makes it scary for me to alter bios, because how do I know I won’t kill the failsafe that is supposed to be there?

    The take away: be afraid, be very afraid of messing with bios in windows 10. Your good backups are worthless for bios screwups.

    1. DVDRambo said on
      Reply

      I recommend that you use a small local shop, with experienced techs that will help you beyond what Best Buy usually does. You never know what you’ll get at Best Buy.

  16. Sophie said on
    Reply

    In essence, Martin’s difficulties highlight what I’ve often found with Windows. Inexplicable things can (and will) happen, for what appears as no reason at all. Especially if you don’t update the O/S “at all”, like me, and rely instead on knowledge, intuition, and many other mitigating actions to threats.

    Windows will often….sooner or later, just do odd stuff.

    @ TeIV, yes…restoring an image (I use Macrium) will surely put that right.

    It does leave you wondering what the next day will bring sometimes! That’s why, just in my opinion, I like to remove ALL variables, and unseen/undocumented issues that Win-update will likely bring with it.

    The other day I was getting boot-loop and BSOD on a more minor PC to my main one. Just couldn’t explain what had changed from one day to the next. It ended up being a faulty memory upgrade that had worked fine since September last year….that suddenly malfunctioned. Took a little while to understand what it was, and thankfully, it was not Windows’s problem (this time!!!)

    1. Bloatware Kills PCs said on
      Reply

      More problems seem to happen if you DO update windows than if you don’t! LOL I haven’t updated any of my Win 7 PCs since ~2014, I don’t run antivirus on them, I’ve disabled every service except the essential Windows services, I only run a firewall on them for security. I’ve had practically no issues with Windows after all the bloat was removed other than minor problems caused by third party software or hardware changes. Even switching from HD to SSD didn’t require an update. The only time I update is either for a specific issue, which you can Google the cause of usually or for a genuinely critical security patch (the majority of those can be reduced by not running a Microsoft browser, scripts in Office, or using Microsoft networking).

      1. Sophie said on
        Reply

        Yes, I’m totally with you! I read my note again, and it looks as if I’m suggesting the opposite….when in fact, what you write is 100% as I see it.

        Basically turn off practically EVERYTHING, and rely on your own good sense and mitigations.

  17. TelV said on
    Reply

    Presumably restoring the OS using a System Image would also do the trick?

Leave a Reply

By commenting, you accept our privacy policy and keep the discussion respectful and on topic.