Where is the BCD file located in the registry?
- BIOS-based operating systems. The BCD registry file is located in the \Boot\Bcd directory of the active partition.
- EFI–based operating systems. The BCD registry file is located on the EFI system partition.
Fix a “Automatic Repair couldn’t repair your PC” on an UEFI system: when Windows cannot be located
Posted by jpluimers on 2025/08/22
I got the below error when booting a Dell Optiplex 7060 Micro, a machine not just supporting supporting UEFI but preferring it, on which I had copied a backed-up disk image, then moved the hidden Recovery partition to the end of the physical disk (to make room to extend either the OS or DATA partitions).
Fixing it lead me to a trip that was on the boundary of software archaeology, so this blog post has a truckload of archived links to information that is still relevant, but for which the original links have long vanished due to link rot or (often worse) part of the historic information got lost because of migration to new tooling forgot to cover important additions (especially in comments).
One thing that I had to unlearn was MBR disk basics, for instance the fact that on GPT disks a partition can be active (they can only be on MBR disks, but despite UEFI supporting both MBT and GPT, GPT disks are way more common and required). The same holds for partitions having a boot flag: that too only applies to MBR disks. For the same reason, bootrec is only useful for MBR disks. More details towards the end of this blog post. CSM (Compatibility Support Module) booting is the UEFI way to simulate BIOS boot for operating systems that do no support UEFI.
Back to the error at hand:
Automatic Repair Automatic Repair couldn't repair your PC Press "Advanced options" to try other options to repair your PC or "Shut down" to turn off your PC. Log file: E:\Recovery\WindowsRE\Winre.wim\System32\Logfiles\Srt\SrtTrail.txt [Shut down] [Advanced options]
The message is from the Windows Boot Manager that was introduced with Windows Vista and Windows Server 2008. I have limited experience with it as my days of multi-boot systems were way before that. Since the introduction of Windows XP and Windows Server 2003 I have run other operating systems as Virtual Machines (mainly using VMware based virtualisation software).
I both wanted to learn more about the Windows Boot Manager and the underlying Boot Configuration Data (BCD) in addition I really did not want to step down from UEFI booting to BIOS based boot (which I have basically lived my whole IBM PC Compatible life). After more than 15 years, it is about time to learn more about this (:
All the reasons to really try to understand, solve this and document this:
After googling around, none of the solutions I found were a good match exactly solving this, but on the up side: they did get me going.
A frustrating part here is that the file E:\Recovery\WindowsRE\Winre.wim\System32\Logfiles\Srt\SrtTrail.txt is nowhere to be found: not on the Windows Recovery Environment (WindowsRE or WinRE) itself and not (after successfully booting) on any of the other partitions on the system.
Boot Configuration Data (BCD) has replaced boot.ini
From Boot Configuration Data (part of Source: Booting process of Windows NT since Vista: Boot Configuration Data – Wikipedia), I knew the BCD is stored in a registry file that on a UEFI system is stored on a FAT32 partition labeled “ESP” (which is the EFI system partition):
Boot Configuration Data (BCD) is a firmware-independent database for boot-time configuration data. It is used by Microsoft’s new Windows Boot Manager and replaces the boot.ini that was used by NTLDR.
Boot Configuration Data is stored in a data file that has the same format as Windows Registry hives and is eventually mounted at registry key
[HKEY_LOCAL_MACHINE\BCD00000](with restricted permissions). For UEFI boot, the file is located at/EFI/Microsoft/Boot/BCDon the EFI System Partition. For traditional BIOS boot, the file is at/boot/BCDon the active partition.
This also means that there is a new boot loader: the successor of NTLDR: Windows Boot Manager (sometimes namet BOOTLDR) which in turn can start winload.exe or winresume.exe.
In cases like this, it is always a good idea to look at Super User. In deed the outcome was helpful [Wayback/Archive] bcdedit – Where is the BCD store physically located? – Super User (thanks [Wayback/Archive] Dims, [Wayback/Archive] FastEthernet and [Wayback/Archive] bbearren)
Q
There are several tools to edit the BCD store, like bcdedit and Visual BCD Editor.
They are editing the so-called “BCD Store”. Where is it located physically?
- In filesystem (where)?
- On physical harddrive sectors (where)?
- On Flash ROM of computer?
- Somewhere else (where)?
A
A
If you have multiple Windows OS’s on a UEFI/GPT system you have only one EFI partition. One BCD Store handles all Windows OS’s and it is in the EFI partition. There are separate entries in the BCD Store for every bootable OS.
Anyway, these are the steps how I solved it on this particular system:
Finding out the boot and ESP volumes, then adding a BCD entry
- On this “Automatic Repair” screen, choose “Advanced options”, then on the next screen “Command Prompt” to start
cmd.exe. - Investigation part
- Run “
diskpart” to start the disk partitioning tool. - Run the below
list,selectanddetailcommands to get details on my system:
Microsoft Windows [Version 10.0.22000.1] (c) Microsoft Corporation. All rights reserved. X:\windows\system32>diskpart Microsoft DiskPart version 10.0.22000.1 Copyright (C) Microsoft Corporation. On computer: MININT-OLQIMTE DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 1863 GB 1024 KB * Disk 1 Online 1863 GB 719 GB * DISKPART> select disk 1 Disk 1 is now the selected disk. DISKPART> detail disk Samsung SSD 970 EVO Plus 2TB Disk ID: {7F4CB78A-4B22-49CD-D4BE-8CF6552F15C1} Type : RAID Status : Online Path : 3 Target : 0 LUN ID : 0 Location Path : PCIROOT(0)#PCI(1700)#RAID(P03T00L00) Current Read-only State : No Read-only : No Boot Disk : Yes Pagefile Disk : Yes Hibernation File Disk : No Crashdump Disk : Yes Clustered Disk : No Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 1 C OS NTFS Partition 117 GB Healthy Boot Volume 2 D DATA NTFS Partition 1023 GB Healthy Volume 3 ESP FAT32 Partition 650 MB Healthy System Volume 4 E NTFS Partition 579 MB Healthy Hidden DISKPART> select volume 3 Volume 3 is the selected volume. DISKPART> detail volume Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- * Disk 1 Online 1863 GB 719 GB * Offline : No DISKPART> list part Partition ### Type Size Offset ------------- ---------------- ------- ------- * Partition 1 System 650 MB 1024 KB Partition 2 Reserved 128 MB 651 MB Partition 3 Primary 117 GB 779 MB Partition 4 Primary 579 GB 118 MB Partition 5 Primary 1023 GB 838 GB Partition 6 Recovery 579 MB 1862 GB DISKPART> select partition 6 Partition 6 is now the selected partition. DISKPART> detail partition Partition 6 Type : de94bba4-06d1-4d40-a16a-bfd50179d6ac Hidden : Yes Required: Yes Attrib : 0X8000000000000001 Offset in Bytes: 1999790669824 Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- * Volume 4 E NTFS Partition 579 MB Healthy Hidden DISKPART> select partition 1 Partition 1 is now the selected partition. DISKPART> detail partition Partition 1 Type : c12a7328-f81f-11d2-ba4b-00a0c93ec93b Hidden : Yes Required: No Attrib : 0X8000000000000000 Offset in Bytes: 1048576 Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- * Volume 3 ESP FAT32 Partition 650 MB Healthy System DISKPART> select partition 3 Partition 3 is now the selected partition. DISKPART> detail partition Partition 3 Type : ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 Hidden : No Required: No Attrib : 0000000000000000 Offset in Bytes: 816840704 Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- * Volume 1 C OS NTFS Partition 117 GB Healthy Boot DISKPART> exitNote:
- You have to start with
list diskand you cannot performlistcommands on other subjects unless you have performed aselecton the encompassing subject (for a vdisk you have to firstattachthe corresponding.vhd/.vhdxfile). - The disk uses a GPT (GUID partition table). Most disks nowadays do as MBR (master boot record) partition tables are basically a thing of the past.
- Be aware there is a clear distinction between partitions and volumes:
- A partition can have a partition type that does not correspond to a Windows manageable volume (the most obvious is type
0x00(MBR partition type) or00000000-0000-0000-0000-000000000000(GUID partition type) which means “empty”), and sometimes (especially on floppy disks or virtual CD/DVD ISO or optical disk images) a volume can exist without a partition. - Volume numbering does not need to be in the same order as partition numbering (you see this above: there
volume 3is part ofpartition 1andvolume 1is part ofpartition 3).
- A partition can have a partition type that does not correspond to a Windows manageable volume (the most obvious is type
- I listed “
partition 6” as that is the Recovery partition that was moved towards the end of the disk and wanted to know its status. - On Windows, a volume can exist without a drive letter assignment. In my case this was the case for the
ESPvolume.
So now I know that the
Bootpartition uses theCdrive letter, and where the EFI System Partition is. So let’s use the Recovery environment to fix the BCD on the EFI System Partition. - You have to start with
- Run “
- Modification part
- The start is to make the “
volume 3” partition accessible by assigning a drive letter to it. If you do this in the existing WindowsRE session, then it will be ephemeral, i.e. lost during the next boot, which is a good thing, so let’s continue in a new diskpart session:
DISKPART> select disk 1 Disk 1 is now the selected disk. DISKPART> select partition 1 Partition 1 is now the selected partition. DISKPART> assign letter=F DiskPart successfully assigned the drive letter or mount point. DISKPART> detail partition Partition 1 Type : c12a7328-f81f-11d2-ba4b-00a0c93ec93b Hidden : Yes Required: No Attrib : 0X8000000000000000 Offset in Bytes: 1048576 Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- * Volume 3 F ESP FAT32 Partition 650 MB Healthy System DISKPART> exit - Now we can fix the BCD on the command prompt:
F:\EFI\Microsoft\Boot>copy BCD BCD.bak 1 file(s) copied. F:\EFI\Microsoft\Boot>bcdboot C:\Windows BFSVC Warning: Failed to forcibly unload the system store. Status = [c000000e] Boot files successfully created.Note that (in retrospect) this did create a second BCD entry (that is set as default), not replace the existing one.
- Exit the
cmd.exeand reboot
- The start is to make the “
Booting and removing the faulty BCD entry
After booting, I was greeted with this boot screen:
The frustrating thing is that it does not mention the drive letter I specified in C:\Windows, but only Volume 3 which does not correspond to the boot volume but does correspond to the ESP volume.
Since I now could at least boot into Windows, it was relatively straightforward to immediately fix it using msconfig. In retrospect (see below under “Future improvement”), I probably should have dug into bcdedit and try to do everything from the WindowsRE prompt.
Anyway: msconfig has a tab called boot where you can Delete an existing entry:
So I selected the one in blue (marked \WINDOWS) and clicked the Delete button.
Now the boot succeeded without the need to select a partition. Yay!
Future improvement
In the future, I should use bcdedit to:
- investigate the current BCD settings
- remove the original one after adding the correct one
- use a better caption (
bcdbootcannot do that)
That would have made it a command-line only solution within the WindowsRE environment.
I did some further research for what I need to attain that, and to directly edit BCD in the registry if I ever need that. I did not figure out all the exact steps yet, just collected the relevant links and abstracts then added them to the sections below.
It was hard getting to these steps, so below are lots of links and a Microsoft article archeology guideline
I’ll start with the archeology as over time, the Microsoft documentation sites have been part of a lot of migrations, the last one starting somewhere in 2015 as you can read in [Wayback/Archive] An Update on the MSDN and TechNet Migration to docs.microsoft.com | Microsoft Learn which describes the effort from the inception in 2015 to the migration results up to 2022.
The examples below are likely incomplete, but already cover some 20 years of history of technet and MSDN article number migration.
Easiest is to use the Wayback Machine as as Archive.is has both far less pages saved and no way to specify wildcards in the time portion of the URL.
These all refer to the same technet content over time:
- web.archive.org/web/*/technet.microsoft.com/en-us/library/cc721886.aspx
- web.archive.org/web/*/technet.microsoft.com/en-us/library/cc721886(v=ws.10).aspx
- web.archive.org/web/*/technet.microsoft.com/en-us/library/cc721886(WS.10).aspx
- web.archive.org/web/*/docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc721886(v=ws.10)
And these to the same MSDN content over time does not keep the ID in tact which makes it much harder to track back from the current state to older versions:
- web.archive.org/web/*/msdn.microsoft.com/en-us/windows/hardware/gg463059.aspx
- web.archive.org/web/*/msdn.microsoft.com/en-us/library/windows/hardware/dn653287(v=vs.85).aspx
I know of these starting combinations in IDs:
ccggffdn
Comments and other community content had various different systems which you can see here:
- “Community Content” web.archive.org/web/20101219102119/http://technet.microsoft.com:80/en-us/library/cc709667(WS.10).aspx
- “Community Content” web.archive.org/web/20110221091536/http://technet.microsoft.com:80/en-us/library/cc709667(WS.10).aspx (layout update)
- “Community Additions” web.archive.org/web/20130304235710/http://technet.microsoft.com:80/en-us/library/cc709667(WS.10).aspx (removed the “Community Content”, at least in the Wayback Machine)
- web.archive.org/web/20160809073831/https://technet.microsoft.com/en-us/library/cc709667(v=ws.10).aspx (removed the “Community Additions”)
- web.archive.org/web/20190518194715/https://technet.microsoft.com/en-us/library/cc709667(v=ws.10).aspx redirects to
- web.archive.org/web/20190518194717/https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc709667(v=ws.10) (new location)
The start of my investigation
- [Wayback/Archive] “Automatic repair couldn’t repair your PC” – Microsoft Community (archived through Google Cache as Microsoft does not allow it to save in either in the Wayback Machine or in Archive.is) was the only one that almost literally had the path
E:\Recovery\WindowsRE\Winre.wim\System32\Logfiles\Srt\SrtTrail.txtin it:
I keep on getting this when i boot up my pc and i can’t seem to reset my pc whatsoever. I dont know what to do. Please help
text:
"Press "Advanced options" to try other options to repair your pc or "shut down" to turn off your PC.
Log File:
D:\Recovery\WindowsRE\Winre.wim\System32\Logfiles\Srt\SrtTrail.txt"The answer however was of no use:
- Use Startup repair: failed
- Uninstall Updates: no use as the original was a copy from a working install
CHKDSK: succeeded- Another try you can give to fix is
SFC SCANNOWthrough Offboot switch.
For this follow the steps below:
First, find the Windows Install drive letter using
BCDEDITcommand.Then, try entering the following command:
sfc /scannow /offbootdir=C:\ /offwindir=C:\WindowsAfter the scan completes you would see the results.
You can also try usingDISM:dism /image:C:\ /cleanup-image /revertpendingactionsno use as the original was a copy from a working install, but interesting is I did not know you could
- Reset this PC or clean install: no use as the original was a copy from a working install
- [Wayback/Archive] Capture and Apply Windows, System, and Recovery Partitions | Microsoft Learn
Configure the system partition by using the BCDBoot tool. This tool copies and configures system partition files by using files from the Windows partition. For example:W:\Windows\System32\bcdboot W:\Windows /s S: - [Wayback/Archive] Boot to a virtual hard disk: Add a VHDX or VHD to the boot menu | Microsoft Learn (using WinPE: Windows Preinstallation Environment which works in a similar way as
Add a boot entry
- From your destination PC, open Diskpart (if necessary) and identify the drive letters of the VHDX and the system partition, for example,
VandS.diskpart list volume exit - Add a boot entry to the device. You can add multiple VHDX files using this method.UEFI:
V:\ cd v:\windows\system32 bcdboot v:\windows /s S: /f UEFIBIOS:
V: cd v:\windows\system32 bcdboot v:\windows /s S: /f BIOS - Remove the WinPE USB key.
- Restart the destination PC.If there’s only one boot entry, the device immediately boots to Windows. If there’s more than one boot entry, you’ll see a boot menu where you can choose between the available versions of Windows on the device.
- From your destination PC, open Diskpart (if necessary) and identify the drive letters of the VHDX and the system partition, for example,
- [Wayback/Archive] Fixing Disk Signature Collisions | Microsoft Learn
in this post, I’ll give you easy repair steps you can follow if you’ve got a system that won’t boot because of a disk signature collision. I’ll also explain where disk signatures are stored, how Windows uses them, and why a collision makes a Windows installation unbootable.
- [Wayback/Archive] windows 7 – Why can’t I edit the system BCD store via regedit? – Super User (thanks [Wayback/Archive] Parmar and [Wayback/Archive] Synetech)
Q
if I try running regedit as an Administrator and manually editing any of the values in there, you get the errorCannot edit <value_name>: Error writing the value's new contents. Similarly, if the Windows API functionRegSetValueExtries changing values in this subkey, even when in an application that is running as an Administrator, it will also fail.Yet, theBCDEDITcommand can insert, update and delete items from this store without issues and the changes will show up in the registry as well.What’s the difference between whatBCDEDITdoes and manually editing the registry?A
…
Since boot data is critical, Windows doesn’t make it easy to mess around in there. Using the registry editor to directly edit the boot data would make it possible to set invalid or conflicting values, add invalid or illegal entires, remove mandatory entries, etc. Limiting the modification of the BCD tobcdeditallows it restrict the changes to valid values which helps to limit the damage that can be done (it doesn’t completely eliminate problems; you can still kill a system, but at least it cuts out a big chunk of possible problems).…
When you run Regedit (which requires elevated privileges), it runs under the context of your user-account and gets the administrator-group permissions, thus you cannot write to it. When you use thebcdeditcommand, it runs under the SYSTEM account context which has write permissions. If you enable the User Name column in the Task Manager, you can see that Regedit is run by your user account andbcdeditis run by SYSTEM.…
An easier way is to simply run Regedit under the SYSTEM context.
…
- [Wayback/Archive] Error message when you start Windows 7: “The Windows Boot Configuration Data file is missing required information” (KB2004518) is still really insightful, but got removed, so here is a full quote:
Symptoms
When you start Windows 7, you receive the following error message:
File: \Boot\BCDStatus: 0xc0000034Info: The Windows Boot Configuration Data file is missing required informationCause
This error occurs when either of the following conditions is true:
- The Windows Boot Manager (Bootmgr) entry is not present in the Boot Configuration Data (BCD) store.
- The Boot\BCD file on the active partition is damaged or missing.
The second bullet refers to the “active partition”, which means the partition identified by the Active bit set on the partition. This is what identifies the ‘system partition’, or in other words, the partition where bootmgr and BCD store are located.Resolution
To resolve this problem, use the following methods in the order in which they are presented.Method 1: Repair the BCD store by using the Startup Repair optionYou can use the Startup Repair option in the Windows Recovery Environment to repair the BCD store. To do this, follow these steps:1. Put the Windows 7 installation disc in the disc drive, and then start the computer.2. Press a key when you are prompted.3. Select a language, a time, a currency, and a keyboard or another input method, and then click Next.4. Click Repair your computer.5. Click the operating system that you want to repair, and then click Next.6. In the System Recovery Options dialog box, click Startup Repair.7. Restart the computer.For more information on how Windows RE Works: http://technet.microsoft.com/en-us/library/dd744291(WS.10).aspxMethod 2: Rebuild the BCD store by using the Bootrec.exe toolIf the previous method does not resolve the problem, you can rebuild the BCD store by using the Bootrec.exe tool in the Windows Recovery Environment.Determine the partition where\boot\bcdfile is located.Notice that theboot\BCDfile may not be on the C: partition but on a separate system partition.(OEM’s are unlikely to assign a volume letter to the system partition.)If the Bootrec.exe tool cannot locate any missing Windows installations, you must remove the BCD store, and then you must re-create it. To do this, type the following commands in the order in which they are presented. Press ENTER after each command.Bcdedit /export C:\BCD_Backupren c:\boot\bcd bcd.oldBootrec /rebuildbcd
In this recovery procedure, because we are in WinRE (which is based on WinPE), all the volumes, including the system partition are assigned drive letters. The order of drive letter assignment may not be (or will not be) the same as how volume letters are assigned when Win7 is running.ren c:\boot\bcd bcd.old
Partition C: might not be the correct volume letter. Here is what we have to do to obtain the correct active partition:If theBootrec.exetool cannot locate any missing Windows installations, you must remove the BCD store, and then you must re-create it. Use the diskpart command to locate the volume letter for the system partition where the BCD store is located. To do this, follow these steps:- At the command prompt type the following commands in the order which they are presented:
-
c:\windows\system32> DiskpartDISKPART> select disk 0DISKPART> list partitionDISKPART> select partition 1DISKPART> detail partition
-
Sample output for example:Partition 1Type : 07Hidden: NoActive: YesOffset in Bytes: 1048576Volume ### Ltr Label Fs Type Size Status Info---------- --- ----------- ----- ---------- ------- --------- --------* Volume 1 D System Rese NTFS Partition 100 MB Healthy SystemThe BCD store is located on the partition where the detail shows “Active : Yes”, and Info is “System”. The partition may have a label “System Reserved”. In this example, Volume 1 is the system partition and Windows has temporarily assigned the volume letter D. If partition 1 is not marked Active, then select partition 2, and view the detail to see whether the next partition is Active and the Info is System. A partition with Info as “Boot”, is the partition where the \Windows directory is located.Partition 2Type : 07Hidden: NoActive: NoOffset in Bytes: 105906176Volume ### Ltr Label Fs Type Size Status Info---------- --- ----------- ----- ---------- ------- --------- --------* Volume 2 C NTFS Partition 100 GB Healthy BootOn Windows Vista, one partition is typically used as both the System and Boot partitions and the \boot\BCD store is located on the same volume where the \Windows directory is located. On Windows 7, separate partitions are used for the System and Boot partitions to make it easier to enable BitLocker Drive Encryption and to support computers that have UEFI firmware.-
In the following commands, use the volume letter identified in the diskpart command for the system partition to remove the BCD store. Type the following commands in the order in which they are presented. Press ENTER after each command.
·Bcdedit /export C:\BCD_Backup·ren Partition:\boot\bcd bcd.old·Bootrec /rebuildbcdNote Partition represents the letter of the system partitionMethod 3: Rebuild the BCD store manually by using the Bcdedit.exe toolIf the previous method does not resolve the problem, you can rebuild the BCD store manually by using the Bcdedit.exe tool in the Windows Recovery Environment.To do this, follow these steps:1. Put the Windows 7 installation disc in the disc drive, and then start the computer.2. Press a key when you are prompted.3. Select a language, a time, a currency, and a keyboard or another input method, and then click Next.4. Click Repair your computer.5. Click the operating system that you want to repair, and then click Next.6. In the System Recovery Options dialog box, click Command Prompt.7. Type the following command, and then press ENTER:cd /d Partition:\Windows\System32Note Partition represents the letter of the partition on which Windows is installed. Typically, this is partition C. Use the diskpart commands described in Method 2 to determine the letter temporarily assigned to the partition on which Windows is installed. The detailed partition information for that partition will show the Info as Boot.8. Type the following command, and then press ENTER:bcdedit /enum allIn the Windows Boot Loader section of the output from this command, note the GUID that is listed for resumeobject. You will use this GUID later.9. Type the following command, and then press ENTER:bcdedit -create {bootmgr} -d "Description"NoteDescriptionrepresents the description for the new entry.10. Type the following command, and then press ENTER:bcdedit -set {bootmgr} device partition=Partition:NotePartitionrepresents the letter of the partition. Typically, the letter isC.11. Type the following command, and then press ENTER:bcdedit /displayorder {GUID}NoteGUIDrepresents the GUID that you obtained in step 8.12. Type the following command, and then press ENTER:bcdedit /default {GUID}NoteGUIDrepresents the GUID that you obtained in step 8.13. Type the following command, and then press ENTER:bcdedit /timeout ValueNoteValuerepresents the time in seconds before the Windows Boot Manager selects the default entry that you created in step 12.14. Restart the computer.More Information
For a Windows Vista version of this article see:Note This is a “FAST PUBLISH” article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations. - [Wayback/Archive] The Windows 7 / 8 / 10 BCD (Boot Configuration Data) Store and BCDEDIT Program has a truckload of notes, especially on disk signatures and on differences between bcdedit versions complete with example output.
The above two links are part of a sub-tree around MBR as the site aims at describing as much information on master-boot records on various operating systems as possible (for instance [Wayback/Archive] Windows 7, 8 or 10 Master Boot Record (MBR)). If you are interested in that topic, start at [Wayback/Archive] Boot Records Revealed!
All the Details of many versions of
both MBR (Master Boot Records)
and OS Boot Sectors (also called:
Volume Boot Records)Note however that the site has a lot of outgoing dead links, so it is often useful to start at a Wayback Machine copy as there these links are often archived.
Links to documentation
BCD
bootrec
Despite I didn’t use bootrec (and later learned it has been replaced by bootsect), a [Wayback/Archive] bootrec Search | Microsoft Learn revealed this truly insightful article: [Wayback/Archive] Windows boot issues troubleshooting – Windows Client | Microsoft Learn.
I wish it had gotten a more prominent result in my Google queries, and can only quote so many bits in this already long blog post, so be sure to read it in full and expand the image (which in large parts should have been converted to HTML tables).
Anyway:
Summary
There are several reasons why a Windows-based computer may have problems during startup. To troubleshoot boot problems, first determine in which of the following phases the computer gets stuck:
Phase Boot Process BIOS UEFI 1 PreBoot MBR/PBR(Bootstrap Code)UEFI Firmware 2 Windows Boot Manager %SystemDrive%\bootmgr\EFI\Microsoft\Boot\bootmgfw.efi3 Windows OS Loader %SystemRoot%\system32\winload.exe%SystemRoot%\system32\winload.efi4 Windows NT OS Kernel %SystemRoot%\system32\ntoskrnl.exe
PreBoot: The PC’s firmware initiates a power-on self test (POST) and loads firmware settings. This pre-boot process ends when a valid system disk is detected. Firmware reads the master boot record (MBR), and then starts Windows Boot Manager. Windows Boot Manager: Windows Boot Manager finds and starts the Windows loader (Winload.exe) on the Windows boot partition. Windows operating system loader: Essential drivers required to start the Windows kernel are loaded and the kernel starts to run. Windows NT OS Kernel: The kernel loads into memory the system registry hive and other drivers that are marked as BOOT_START.The kernel passes control to the session manager process (Smss.exe) which initializes the system session, and loads and starts the devices and drivers that aren’t marked BOOT_START.Here’s a summary of the boot sequence, what will be seen on the display, and typical boot problems at that point in the sequence. Before you start troubleshooting, you have to understand the outline of the boot process and display status to ensure that the issue is properly identified at the beginning of the engagement. Select the thumbnail to view it larger.Each phase has a different approach to troubleshooting. This article provides troubleshooting techniques for problems that occur during the first three phases.
The image is so important that I archived the high-resolution one at [Wayback/Archive] boot-sequence-thumb-expanded.png (1164×1035). It should be an HTML table, so maybe one day..
NoteIf the computer repeatedly boots to the recovery options, run the following command at a command prompt to break the cycle:Bcdedit /set {default} recoveryenabled noIf the F8 options don’t work, run the following command:Bcdedit /set {default} bootmenupolicy legacyMethod 2: Repair boot codes
To repair boot codes, run the following command:BOOTREC /FIXMBRTo repair the boot sector, run the following command:BOOTREC /FIXBOOTNoteRunningBOOTRECtogether withFixmbroverwrites only the master boot code. If the corruption in the MBR affects the partition table, runningFixmbrmay not fix the problem.Method 3: Fix BCD errors
If you receive BCD-related errors, follow these steps:
Scan for all the systems that are installed. To do this step, run the following command:Bootrec /ScanOS Restart the computer to check whether the problem is fixed. If the problem isn’t fixed, run the following commands:bcdedit /export c:\bcdbackup attrib c:\boot\bcd -r -s -h ren c:\boot\bcd bcd.old bootrec /rebuildbcd Restart the system.The article continues with a few more types of fixes that are not applicable to the BCD so I left them out.
If bootrec had still existed in Windows 11, then Method 3: Fix BCD errors would likely have solved my problem.
bootsect
[Wayback/Archive] Bootsect Command-Line Options | Microsoft Learn is the replacement of bootrec. The most important parameter choices are these:
-
/nt52Applies the master boot code that is compatible with
NTLDRtoSYS,ALL, or<DriveLetter>. The operating system installed onSYS,ALL, or<DriveLetter>must be older than Windows Vista. -
/nt60Applies the master boot code that is compatible with
BootmgrtoSYS,ALL, or<DriveLetter>. The operating system installed onSYS,ALL, or<DriveLetter>must be Windows 8, Windows Server 2012, or newer.
The odd thing is that /nt60 does not mention “Windows Vista, Windows Server 2008 or newer”, as both these Windows NT releases are NT 6.0 (the series ended with NT 6.3 covering both Windows 8.1 and Windows Server 2012 R2, then NT 10.0 for Windows 10 and Windows Server 2016).
More options are in the article.
diskpart
- [Wayback/Archive]
diskpart| Microsoft Learn- [Wayback/Archive]
assign| Microsoft Learn (note the inverse is notunassign, butremove) - [Wayback/Archive]
attach vdisk| Microsoft Learn - [Wayback/Archive]
detail| Microsoft Learn - [Wayback/Archive]
detail disk| Microsoft Learn - [Wayback/Archive]
detail partition| Microsoft Learn - [Wayback/Archive]
detail volume| Microsoft Learn - [Wayback/Archive]
list| Microsoft Learn - [Wayback/Archive]
remove| Microsoft Learn (which would be far easier to understand asunassign) - [Wayback/Archive]
selectcommands | Microsoft Learn - [Wayback/Archive]
select disk| Microsoft Learn - [Wayback/Archive]
select partition| Microsoft Learn - [Wayback/Archive]
select vdisk| Microsoft Learn - [Wayback/Archive]
select volume| Microsoft Learn
- [Wayback/Archive]
- [Wayback/Archive]
diskpartscripts and examples | Microsoft Learn
Usediskpart /sto run scripts that automate disk-related tasks, such as creating volumes or converting disks to dynamic disks. Scripting these tasks is useful if you deploy Windows by using unattended Setup or the Sysprep tool, which do not support creating volumes other than the boot volume. - [Wayback/Archive] Shrink a basic volume | Microsoft Learn
You can decrease the space used by primary partitions and logical drives by shrinking them into adjacent, contiguous space on the same disk.
…
To shrink a basic volume using a command line
-
Open a command prompt and type
diskpart. -
At the DISKPART prompt, type
list volume. Note the number of the simple volume you want to shrink. -
At the DISKPART prompt, type
select volume <volumenumber>. Selects the simple volume volumenumber you want to shrink. -
At the DISKPART prompt, type
shrink [desired=<desiredsize>] [minimum=<minimumsize>]. Shrinks the selected volume to desiredsize in megabytes (MB) if possible, or to minimumsize if desiredsize is too large.
-
I did not know about the last two possibilities. Learning things like that was a big plus from researching his problem!
bcdboot
- [Wayback/Archive]
bcdboot| Microsoft Learn - [Wayback/Archive] BCDBoot Command-Line Options | Microsoft Learn starts with
BCDBoot is a command-line tool used to configure the boot files on a PC or device to run the Windows operating system. You can use the tool in the following scenarios:- Add boot files to a PC after applying a new Windows image. In a typical image-based Windows deployment, use BCDBoot to set up the firmware and system partition to boot to your image. To learn more, see Capture and Apply Windows, System, and Recovery Partitions.
- Set up the PC to boot to a virtual hard disk (VHD) file that includes a Windows image. To learn more, see Boot to VHD (Native Boot): Add a Virtual Hard Disk to the Boot Menu.
- Repair the system partition. If the system partition has been corrupted, you can use BCDBoot to recreate the system partition files by using new copies of these files from the Windows partition.
- Set up or repair the boot menu on a dual-boot PC. If you’ve installed more than one copy of Windows on a PC, you can use BCDBoot to add or repair the boot menu.
It can do more (like updating NVRAM): just read the full page for that info.
- [Wayback/Archive] Capture and Apply Windows, System, and Recovery Partitions | Microsoft Learn
- [Wayback/Archive] Boot to a virtual hard disk: Add a VHDX or VHD to the boot menu | Microsoft Learn (in the past I used this for running Windows 8.1 and Windows 10 in parallel but in retrospect I would opt for a Virtual Machine approach in the future)
Note: I wish bcdboot had a way to specify the caption of a boot entry as that made figuring out the boot prompt choice I had above a lot easier.
bcdedit
- [Wayback/Archive] Bcdedit | Microsoft Learn is the entry that showed up in the search results first, but despite the SEO it is very thin in actual information:
…
BCDEdit is a command-line tool for managing BCD stores. It can be used for a variety of purposes, including creating new stores, modifying existing stores, adding boot menu parameters, and so on. BCDEdit serves essentially the same purpose as Bootcfg.exe on earlier versions of Windows, but with two major improvements:-
Exposes a wider range of boot parameters than Bootcfg.exe.
-
Has improved scripting support.
…Examples
For examples of BCDEdit, see the Windows Hardware Developer Center Web site (go.microsoft.com/fwlink/?linkid=69448). -
- Note that the last link go.microsoft.com/fwlink/?linkid=69448 fails, but has moved to various places over time:
- from go.microsoft.com/fwlink/?linkid=69448
- via www.microsoft.com/whdc/system/platform/firmware/bcd.mspx (see [Wayback/Archive] -> www.microsoft.com/whdc/system/platform/firmware/bcd.mspx via web.archive.org/web/*/go.microsoft.com/fwlink/?linkid=69448)
- and msdn.microsoft.com/en-us/windows/hardware/gg463059.aspx (see [Wayback/Archive] -> msdn.microsoft.com/en-us/windows/hardware/gg463059.aspx via web.archive.org/web/*/https://www.microsoft.com/whdc/system/platform/firmware/bcd.mspx)
- to [Wayback/Archive] learn.microsoft.com/en-us/previous-versions/windows/hardware/design/dn653287(v=vs.85)?redirectedfrom=MSDN
- and finally [Wayback/Archive] Boot Configuration Data in Windows Vista – Windows 10 hardware dev | Microsoft Learn
We’re no longer updating this content regularly. Check the Microsoft Product Lifecycle for information about how this product, service, technology, or API is supported.
…
Boot Configuration Data in Windows Vista
- Article•
- •
- 2 minutes to read
…
Information about the Windows Vista boot environment and the boot configuration data (BCD) store.File name: BCD.docx298 KBMicrosoft Word fileMicrosoft has completely reengineered the boot environment for Microsoft Windows Vista to address the increasing complexity and diversity of modern hardware and firmware. One aspect of this reengineering is a new firmware-independent data store that contains configuration data that influences the boot process. This paper provides an overview of this configuration data – called boot configuration data (BCD) – and describes how to use the related tools to manage boot options.What’s New:
- References to Longhorn removed
Included in this paper:
- BCD Architecture
- Tools for Managing BCD
- How to Manage BCD Programmatically with WMI
- BCD Cookbook
…
And the bcd.docx Download is archived at [Wayback: bdc.docx] and was last updated in februari 2008 with only minor changes to the initial 22 pages in the version below.
The initial 206 version from go.microsoft.com/fwlink/?linkid=69448 version [Wayback/Archive] Boot Configuration Data in Windows Vista is BCD.doc download and archived at [Wayback: BCD.doc]).
- The above document also got an important outgoing link, this time to [Wayback/Archive] EFI and Windows Vista (www.microsoft.com/whdc/system/platform/firmware/efibrief.mspx) which by now has disappeared (the archival links are the most recent version) which is a shame as it describes the early stages and summarises the current implementation:
This paper briefly describes Microsoft plans for supporting the Extended Firmware Interface (EFI) in Microsoft Windows operating systems and provides a brief background for related technical issues.
…
Following are specifics of EFI versus BIOS boot:
- To install the operating system by way of UEFI requires that the installation be booted via UEFI and vice versa-that is, an operating system installed via BIOS can only boot via BIOS. Once the operating system is installed via EFI, it can only boot via EFI because booting via BIOS cannot access the operating system metadata (BCD boot options) on the EFI System Partition (ESP).
- Windows shipping on optical media will be able to boot either via UEFI or BIOS. El Torito multiple boot catalog support is used for this capability.
- The default El Torito boot entry will be BIOS ETFS bootstrap code with an “X86” platform tag. For this to work:
- The BIOS must support multiple boot entries.
- It must ignore entries that do not have the “x86” tag.
- It should default to booting the default entry.
- The second El Torito boot entry will be for EFI boot application and will have the “EF” platform tag. This tag points to a mountable file system containing
\EFI\BOOT\BOOTX64.EFI.
EFI should ignore the PC/AT BIOS entry and recognize the EFI entry to mount the ESP partition before launching the boot application. - For platforms supporting UEFI and BIOS, the platform should default to boot via EFI.
- Windows is planned to support both CD and DVD/UDFS boot. UDFS also uses El Torito and is built using the UDFS bridge format.
- A UEFI system requires a separate EFI system partition (ESP). BIOS systems should also implement a separate system partition for the proper functioning of Windows Vista and Windows Server 2008 features such as BitLocker Drive Encryption. This will also enable a smoother transition to EFI systems.
- For SysPrep migration between EFI and BIOS systems, Windows state should not be maintained on the system partition.
…
- ACPI Specification
http://www.acpi.info - El Torito Specification
http://www.phoenix.com/NR/rdonlyres/98D3219C-9CC9-4DF5-B496-A286D893E36A/0/specscdrom.pdf - Microsoft BitLocker Drive Encryption White Paper
http://www.microsoft.com/technet/windowsvista/security/bitexec.mspx - Microsoft Boot Configuration Data
http://msdn2.microsoft.com/en-us/library/aa362692.aspx - Microsoft Extensible Firmware Initiative FAT32 File System Specification
http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx - Microsoft Platform Design Portal
http://www.microsoft.com/whdc/system/platform/default.mspx - Microsoft Portable Executable and Common Object File Format Specification
http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx - Unified EFI Update [WinHEC 2005 Presentation]
http://www.microsoft.com/whdc/system/platform/firmware/default.mspx - United Extensible Firmware Interface Specification
http://www.uefi.org
Note that many of these links have died because of link rot: a recurring pattern with a lot of the Microsoft BCD and EFI documentation. I tried to resurrect a few:
- [Wayback/Archive] www.acpi.info vanished after the mid 2019 archival.
- [Wayback/Archive] www.phoenix.com/NR/rdonlyres/98D3219C-9CC9-4DF5-B496-A286D893E36A/0/specscdrom.pdf then vanished after the 2009 archival.
- [Wayback/Archive] www.microsoft.com/technet/windowsvista/security/bitexec.mspx moved to [Wayback/Archive] technet.microsoft.com/en-us/windowsvista/aa906018.aspx which moved to [Wayback/Archive] technet.microsoft.com/en-us/windows/aa906018.aspx (which indicates it is deleted)
- [Wayback/Archive] msdn.microsoft.com/en-us/library/aa362692.aspx moved to [Wayback/Archive] msdn.microsoft.com/en-us/library/bb986746.aspx which moved to [Wayback/Archive] Boot Configuration Data WMI Provider | Microsoft Learn
- [Wayback/Archive] www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx moved to [Wayback/Archive] msdn.microsoft.com/en-us/windows/hardware/gg463080.aspx which moved to [Wayback] download.microsoft.com/download/0/8/4/084C452B-B772-4FE5-89BB-A0CBF082286A/fatgen103.doc
- [Wayback/Archive] www.microsoft.com/whdc/system/platform/default.mspx moved to [Wayback/Archive] msdn.microsoft.com/en-us/windows/hardware/gg462970.aspx which moved to [Wayback/Archive] Design Windows devices | Microsoft Learn
- [Wayback/Archive] www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx moved to [Wayback/Archive] msdn.microsoft.com/en-us/windows/hardware/gg463119.aspx which moved to (non-archived) msdn.microsoft.com/en-us/library/windows/desktop/ms680547.aspx which moved to [Wayback/Archive] msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx which moved to [Wayback/Archive] docs.microsoft.com/en-us/windows/desktop/Debug/pe-format with at least revisions 6.0, 8.0, 8.2, 8.3 and currently non-numbered.
-
- [Wayback/Archive] www.microsoft.com/whdc/system/platform/firmware/default.mspx moved to [Wayback/Archive] msdn.microsoft.com/en-us/windows/hardware/gg463075.aspx which moved to [Wayback/Archive] Firmware and Boot Environment – Windows 10 hardware dev | Microsoft Learn.
- [Wayback/Archive] Welcome to Unified Extensible Firmware Interface Forum | Unified Extensible Firmware Interface Forum
- [Wayback/Archive] Edit boot options – Windows drivers | Microsoft Learn is the starting point of a few practical documentation entries on
bcdeditexamples:- [Wayback/Archive] Changing Boot Parameters – Windows drivers | Microsoft Learn has a few examples using
bcdeditto set parameters or enable/disable debug. - [Wayback/Archive] Adding Boot Entries – Windows drivers | Microsoft Learn shows many examples of using
bcdeditlike adding, editing, removing and changing the order. Not all of hem go in great detail (for instance only few mappings are made between GUIDs and named entries), but still a lot better than the previous bcdedit documentation entries. - [Wayback/Archive] Changing the Default Boot Entry – Windows drivers | Microsoft Learn with examples including
bcdedit /default {ntldr} - [Wayback/Archive] Changing the Boot Menu Time-out – Windows drivers | Microsoft Learn with an example on
bcdedit /timeout - [Wayback/Archive] Changing the Friendly Name of a Boot Entry – Windows drivers | Microsoft Learn which I would have used in my solution if I had known it in advance
- [Wayback/Archive] Changing Boot Parameters – Windows drivers | Microsoft Learn has a few examples using
- [Wayback/Archive]
BCDEditOptions Reference – Windows drivers | Microsoft Learn is so much better than the first result as it shows every parameter and includes at least one example for each:- [Wayback/Archive]
BCDEdit /bootsequence– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /bootdebug– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /dbgsettings– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /debug– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /deletevalue– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /displayorder– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /ems– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /emssettings– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /enum– Windows drivers | Microsoft Learn (which is the default, so you can omit/enum) - [Wayback/Archive]
BCDEdit /event– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /hypervisorsettings– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /hypervisorsettings– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /set– Windows drivers | Microsoft Learn (note there is a truckload of settings, so this is a really long page with explanations and examples) - [Wayback/Archive]
BCDEdit /timeout– Windows drivers | Microsoft Learn - [Wayback/Archive]
BCDEdit /toolsdisplayorder– Windows drivers | Microsoft Learn
- [Wayback/Archive]
- [Wayback/Archive] BCDEdit Commands for Boot Environment – Windows 10 hardware dev | Microsoft Learn
On Microsoft Windows Vista and later versions, the boot configuration data (BCD) store, contains the boot configuration parameters and controls the computer’s boot environment. BCDEdit is a command-line tool that can be used to add, delete, edit, and modify data in a BCD store. The paper is a reference for BCDEdit commands, data types, and well-known identifiers.File name: BCDedit_reff.docxWhat’s New:
- Added /clean option to the /import command.
Included in this white paper:
- BCDEdit Commands
- BCDEdit Identifiers
- BCDEdit Data Formats
- BCDEdit Data Types
The bcdedit_reff.docx is also archived at [Wayback: bcdedit_reff.docx] a 32-pagebcdeditreference that I think is better than the current documentation pages. - [Wayback/Archive] BCDEdit Command-Line Options | Microsoft Learn (learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc709667(v=ws.10)) survived but has removed all the useful comments from the predecessor, so here are a few of these comments (some trimmed for brevity) from [Wayback/Archive] BCDEdit Command-Line Options:
BCDBoot
In addition to the excellent comments by Elmue, below, there’s also BCDBoot.I don’t know why BCDBoot isn’t being trumpeted from the rooftops. It just saved my a** with a Windows Server 2012R2 “boot files corrupted” scenario in a single shot.See this reference: technet.microsoft.com/en-us/library/gg577238.aspxDeleting entries
Amazing… there are tons of information about bcdedit and non contains an example of deleting an entry.How do I delete a replicated entry:bcedit /copy {current} /d “Replicated”This newly created entry will create a yet another one boot entry with the SAME GUID as used in the current (default) boot entry.Now that suppose I want to delete this replicated entry. How do I do that? What will do the following:bcdedit /d {GUID}where GUID is the one used for the Replicated entry? What will it delete? The {current} entry? The Replicated entry? How will it distinguish between entries provided that both have same GUID. The article does not explain this…reference for bcdedit /set options
Winload.exe is missing or corrupt – Recover DVD does not boot – Problem SOLVED!
How to use BCDEDIT in case of emergency:
After a power failure the Master Boot Record (MBR) got destroyed on my harddisk.
…
So I searched for a tool that may recover the MBR.
And I found “EaseUs Partition Recovery”.
[Wayback/Archive] www.softpedia.com/get/System/Back-Up-and-Recovery/EASEUS-Partition-Recovery.shtmlI put the corrupted disk into another computer.
This program scanned my disk and found all partitions within one minute.
It allowed me to enable the partitions and I saw that all data was still there.And the best of all: This program did that great work for free!
…
After reinstalling the Boot Manager I noticed that the Windows XP partitions were still running fine while Windows Vista did not boot any more with a blackscreen:
…
Windows failed to start. A recent hardware or software change might be the cause. File: \Windows\System32\winload.exe Status: 0xc000000e Info: The selected entry could not be loaded because the application is missing or corrupt.…
Here comes the solution that I found on my own:
- Put the harddisk with the corrupt Vista into another computer that is running Windows (in my case Windows XP).
- Mount the defective Vista partition on a drive (in my case
F:\) - On the Vista partition the file
F:\Boot\BCDis the one that needs to be repaired.
You can make a backup of this file now, but why should you backup a corrupt file ?This file has no extension, the name is simply “BCD“.
This file is a database that stores the information how to boot Windows and replaces the formerBoot.ini.
This file is hidden. If you don’t see it use a real file manager like TotalComander because Windows Exporer really sucks. - Open a command prompt (
Cmd.exe) - Enter
F:\Windows\System32\bcdedit /store F:\Boot\BCD /enumNOTE:
The parameter/storewill accessF:\Boot\BCD, otherwise it would accessC:\Boot\BCDwhich does not exist on Windows XP!What I saw was this:
Windows Boot Manager -------------------- identifier {bootmgr} device unknown description Windows Boot Manager locale en-US inherit {globalsettings} default {default} resumeobject {1f20452f-f2af-11db-9299-adf714858873} displayorder {default} toolsdisplayorder {memdiag} timeout 30 Windows Boot Loader ------------------- identifier {default} device unknown path \Windows\system32\winload.exe description Microsoft Windows Vista locale en-US inherit {bootloadersettings} osdevice unknown systemroot \Windows resumeobject {1f20452f-f2af-11db-9299-adf714858873} nx OptInThis is the content of a corrupt
BCDfile.
I have no idea what destroyed this file in my case.
But you see that there are three lines with “unknown“.
This is the cause why Vista does not boot anymore.The
Windload.exeis NOT corrupt or missing.
The corrupt file is theBCDfile, but the programmers at Microsoft are not able to show helpfull error messages. - Now enter the following 3 commands:
F:\Windows\System32\bcdedit /store F:\Boot\BCD /set {bootmgr} device boot The operation completed successfully. F:\Windows\System32\bcdedit /store F:\Boot\BCD /set {default} device boot The operation completed successfully. F:\Windows\System32\bcdedit /store F:\Boot\BCD /set {default} osdevice boot The operation completed successfully. - To check the result enter again:
F:\Windows\System32\bcdedit /store F:\Boot\BCD /enumNow it should look like this:
Windows Boot Manager -------------------- identifier {bootmgr} device boot description Windows Boot Manager locale en-US inherit {globalsettings} default {default} resumeobject {1f20452f-f2af-11db-9299-adf714858873} displayorder {default} toolsdisplayorder {memdiag} timeout 30 Windows Boot Loader ------------------- identifier {default} device boot path \Windows\system32\winload.exe description Microsoft Windows Vista locale en-US inherit {bootloadersettings} osdevice boot systemroot \Windows resumeobject {1f20452f-f2af-11db-9299-adf714858873} nx OptInYou see that instead of “
unknown” there is a “boot” now three times. - Now
BcdEdithas fixed theBCDfile and you are ready.
add cross-reference to FAQ
This topic could be greatly improved by the addition of specific examples, such as those found in the BCDEDIT FAQ: [Wayback/Archive] http://technet.microsoft.com/en-us/library/cc721886(WS.10).aspx
sfc
-
-
- [Wayback/Archive] sfc | Microsoft Learn
Scans and verifies the integrity of all protected system files and replaces incorrect versions with correct versions. If this command discovers that a protected file has been overwritten, it retrieves the correct version of the file from thesystemroot\folder, and then replaces the incorrect file.…
/offwindir<offline windows directory>Specifies the location of the offline windows directory, for offline repair. /offbootdir<offline boot directory>Specifies the location of the offline boot directory for offline repair. /offlogfile=<log file path>Specifies a location to sto I did not know about the offline switches: useful!
- The Dell documentation gives an example at [Wayback/Archive] How to run
sfc /scannowfrom the Windows Recovery Environment (WinRE) | Dell Canada
When runningsfc /scannowin WinRE, two switches need to be added to the command in order to run it in offline mode:/offbootdir=<disk>indicates the boot drive letter./offwindir=<folder>indicates the folder where Windows is installed.
The following is an example of the command with these switches added:sfc /scannow /offbootdir=D:\ /offwindir=D:\Windows
- [Wayback/Archive] sfc | Microsoft Learn
-
VHD booting
[Wayback/Archive] Windows 7 – VHD Boot – Setup Guideline | Microsoft Learn
Links other than Microsoft documentation
These were also helpful getting a grasp on various commands:
- [Wayback/Archive] command line – Scripting with bcdedit – Stack Overflow (thanks [Wayback/Archive] Henrik Nielsen) on the handling GUIDs used inside the BCD within scripts.
- [Wayback/Archive] Use EC2Rescue for Windows Server with the command line – Amazon Elastic Compute Cloud (on collecting BCD related data)
- [Wayback/Archive] NeoSmart: bootcfg – Guide for Windows XP (potentially interesting as Windows XP is not dead yet for system like industrial like ones).
- [Wayback/Archive] NeoSmart: BCDEdit – Guide for Windows Vista, 7, 8, 10
- [Wayback/Archive] Fix UEFI Boot: Fix for Windows 7, 8, 8.1, 10 has OK steps (but no explanation why they work) under Fix #1: Use diskpart.
- [Wayback/Archive] How to Use the Advanced Startup Options to Fix Your Windows 8 or 10 PC has good screenshots on Advanced Startup Options on Windows 8 and 10: useful for people liking visual steps.
- [Wayback/Archive] Fixed: the Selected Disk Is Not a Fixed MBR Disk (Guide 2022) explaining the below error (as a key difference between UEFI and MBR, and that GPT is a requirement for any disk larger than 2 Tebibyte which most hard disks are by now and many SSDs too).
The ACTIVE command can only be used on fixed MBR disks.
It is telling you that the ACTIVE command can only be used on fixed MBR disks – but what does this mean?To clear things up, the error occurs when you want to activate a partition on a UEFI System Partition. However, the active command only works when your system disk is MBR style, as UEFI has no concept of the active partition. So, for this reasons, the same error can occur if you use the INACTIVE command on UEFI/GPT system.
Yup, I totally forgot about that.
Note that a GPT disk *does* contain a Master Boot Record (see GUID Partition Table: MBR Variants – Wikipedia), which is the reason that
bootrec /fixmbrstill is needed to fix some classes of boot problems.I think that resources like this one and [Wayback/Archive] Fix: The Selected Disk is not a Fixed MBR Disk – Appuals.com do neither stress enough that converting GPT to MBR usually is not leading to a successful solution not explain the why in each step of the proposed solutions, like this order:
bootrec /RebuildBcd bootrec /fixMbr bootrec /fixbootIt also means that the solutions in [Wayback/Archive] Know How to Make Partition Bootable in Windows Using CMD OR Diskpart are of no use (besides
diskpartrunning insidecmd, so there is no “OR”) - For the above reason, [Wayback/Archive] windows – Finding which partition on a particular disk is active from the command line – Super User (thanks [Wayback/Archive] Harry Johnston and [Wayback/Archive] Winter Faulk) fails for GPT disks but succeeds on MBR disks:
do the following:diskpart.exe select volume 1 detail partitionThe output will indicateActive: Yes/NoYou have to go through each volume to find which ones are Active and which ones are not. You can use Diskpart’slist volumecommand to show all volumes and find the one you want to check first. - [Wayback/Archive] How can I repair Windows 10 UEFI Normal Boot? – Super User didn’t get resolved, but did point me in the bcdboot direction (so thanks [Wayback/Archive] hockeykong and [Wayback/Archive] snayob) and confirmed why it was a good idea to finally learn about UEFI boot:
-
Boot your Windows 10 DVD using UEFI boot (or disable CSM, so you cannot boot using boot records)
-
Map EFI System on SSD to
Z:using diskpart -
bcdboot c:\windows /s Z: /f UEFI
assumingc:maps to Windows partition on SSD.Forget about unreliable bootrec – the main problem seems to be inability to find EFI System.Other problem you have – disable fastboot so Windows 10 does a full restart (and full shutdown)And … forget about MBR on UEFI (one of the main reasons for implementing EFI is to get rid of MBR and its limitations and problems) -
- [Wayback/Archive] How to Repair EFI/GPT Bootloader on Windows 10 or 11? | Windows OS Hub was basically the first link I found bringing all steps together. And it expplains the the bootrec steps would not work on my system (which I already expected, as I could not reason why my MBR would be broken):
At this point, many guides recommend running the following commands, which should overwrite the partition boot record, find the installed Windows, and add them to the BCD:
bootrec /fixboot bootrec /scanos bootrec /rebuildbcdor even:
bootrec /FixMbr(preparing MBR record for a GPT disk looks strange)You can use all these commands only for MBR-based disks. If your computer boots in UEFI mode, then it definitely uses the GPT partition table (as in our case). Therefore, when you run
bootreccommands, you will see an error:
access is deniedYou need to use the
BCDBoot.exetool to restore bootloader files and fix the boot records on the EFI partitionSo definitely read this article to explain details I might have forgotten to include here. There are a ton of useful comments (the article even got changed a few times because of them) that go into some details more deeply.
- [Wayback/Archive] How to Repair the EFI Bootloader on a GPT Hard Drive for Windows Operating Systems on your Dell Computer | Dell US gives better examples than the Microsoft documentation. Still wish they explained the *why* of the steps better.
- [Wayback/Archive] grub – How to fix the Windows 10 boot loader from Windows – Super User which described why I have always been careful with multi-boot systems: fiddling with boot-loaders is always a pain and provides fixes for both BIOS/MBR and UEFI/GPT boot situations! (thanks [Wayback/Archive] devurandom, [Wayback/Archive] snayob, [Wayback/Archive] devurandom and [Wayback/Archive] Nathan2055)
Q
I installed Ubuntu on a system that has Windows 10 installed. I can boot to Windows or Ubuntu normally using GRUB. I want to delete Ubuntu partition, but first I must restore the Windows 10 MBR.
In Use Bootrec.exe in the Windows RE to troubleshoot startup issues (applies to Windows 7 and Windows Vista) they say to use Bootrec.exe with options
/FixMbr/FixBoot, but when I type “bootrec.exe /FixMbr” in a command prompt, Windows says:'bootrec.exe' is not recognized as an internal or external command.I say I can boot to Windows 10 and run a command prompt from there (I don’t need to use an installation medium), but I don’t know what to enter.
A
The command in Windows 8/8.1/10 for fixing MBR is “bootsect.exe”.
bootsect /nt60 drive_letter: /mbrthis fixes boot record of partition mapped to “drive_letter:” and the MBR of the disk where the partition is placed.
C:\Windows\system32>bootsect bootsect {/help|/nt60|/nt52} {SYS|ALL|<DriveLetter>:} [/force] [/mbr] Boot sector restoration tool Bootsect.exe updates the master boot code for hard disk partitions in order to switch between BOOTMGR and NTLDR. You can use this tool to restore the boot sector on your computer. Run "bootsect /help" for detailed usage instructions.Alternatively you can use “Dual-boot Repair Tool” which has a graphical interface to bcdboot.exe, bootsect.exe and other useful functions like boot sector view and … one click dual-boot repair function for Windows 10/8/7/Vista (also can fix Windows XP boot files).
C
The hint towards
bcdbootwas immensely helpful. Thank you! During a disk crash, my EFI system partition got destroyed. I recreated the files necessary to start my Linux system, but was not able to recover the Windows installation. Usingbcdbootto copy the Windows boot files into it fixed it.A
The other answers given here work great on MBR/BIOS systems, however if you’re on a UEFI system like I am,
bootsectwill just write a semi-functional boot MBR over the GPT protective MBR andbootrecjust gives an “Access denied” error message, and neither one has a functional option to fix a broken EFI system partition, which on a UEFI/GPT drive is what contains the bootloader that used to be stored in the MBR. There’s unfortunately almost no up-to-date guides on fixing the UEFI Windows Boot Manager (almost all of them just say to run the graphical Startup Repair utility, but that doesn’t fix the problem in all cases), but I finally found the correct solution buried in this article, which requires the use of thebcdbootcommand instead:- Grab the Media Creation Tool, make yourself a Windows 10 installation DVD or USB drive, and then boot into it.
- When prompted, choose “Repair your computer”, followed by “Troubleshoot”, “Advanced Options”, and finally “Command Prompt”.
- Run
diskpartand thenlist volume. Note the volume number for your EFI system partition (ESP). - Now do
select volume x(wherexis the volume number for the ESP) and thenassign letter=N:to mount the partition. Runlist volumeagain and note that the ESP is now assigned a driver letter. Runexitto leavediskpart. - (Optional) If you are not currently dual booting and want to fully clean the ESP before writing a new bootloader, run
format N: /FS:FAT32to reformat it as FAT32. This is probably not necessary under normal circumstances, however, asbcdbootseems to do a good job of cleaning things up itself. Especially do not do this if you have a Linux distro on another partition or else you’ll have to reinstall GRUB as well once you’re done with this. Also note that the following steps should not affect an EFI GRUB install as long as you do not otherwise delete GRUB’s existing directory on the ESP. - Finally, write the new bootloader to the partition with
bcdboot C:\windows /s N: /f UEFI. This command rebuilds a new UEFI-compatible bootloader on the ESP mounted at N: using the Windows installation mounted atC:\windows.Once it’s done, you can verify the new bootloader was written by runningdir N:\EFI, where you should see aMicrosoftdirectory containing the new Windows Boot Manager as well as abootdirectory containing the fallback bootloader (along with other directories for any other bootloaders you have installed, such as GRUB for Linux). - (Optional) If you are dual booting, you will probably need to boot into your Linux distro and run
sudo update-grubto allow the GRUB scripts to detect and add the new Windows bootloader. You should also skip the next step and leave GRUB as your first boot choice so you can access both operating systems. - Now boot into your BIOS setup and make sure “Windows Boot Manager” is set as the top boot choice. Save and reboot and you’ll finally be back in Windows.
Especially the last answer is golden and basically describes in detail why my fix above works.
Oh:
- [Wayback/Archive] UEFI dual boot 2x WIN 10 Pro failing Solved – Page 2 – Windows 10 Forums motivated me to ignore the
BFSVC Warning: Failed to forcibly unload the system store. Status = [c000000e]and just reboot; it also confirmed me why hesitation to do multi-boot systems:
if you are dual booting Windows 10, it is a very good idea to disable hibernation on both Windows installs:
powercfg -h off
The hiberfil.sys file created by enabling hibernation and, thus, Winodws 10 fast startup can interfere with dual booting.
Editing the BCD in the registry
I have not don this yet, and likely never will as regular BCD editing tools will take care of almost all of the bit fiddling in the BCD registry. They also make the transition to the LocalSystem user (.\SYSTEM usually displayed as NT Authority\System).
There are only rare circumstances where they have not enough power which usually has to do with disk signatures of byte-cloned disks. In that case the MBR of the cloned disk will contain the disk signature of the original disk. If both are in the same system that imposes a problem, as BCD is (despite the tools based on drive letters) is based on disk signatures.
Running as LocalSystem user
These links explain this and can be of help fixing such a situation:
- [Wayback/Archive] How to Run a Program as SYSTEM (LocalSystem) Account in Windows » Winhelponline
To start the Registry Editor under the SYSTEM account, type the following command, and press ENTER:
d:\tools\psexec.exe -sid c:\windows\regedit.exe
The abovePsExeccommand-line starts the Registry Editor underLOCALSYSTEMaccount so that you can modify protected areas in the registry.This is equivalent to running
psexec.exe -s -i -d c:\windows\regedit.exeWhere this is the meaning of the parameters:
-srun as LocalSystem-iallow interaction with the desktop-ddon’t wait for the process to exit
Note that
PsExecrequires UAC elevated permissions to perform the above action. - [Wayback/Archive] windows services – How do you run CMD.exe under the Local System Account? – Stack Overflow shows running as
LocalSysteminteractively has become a lot harder since the introduction of Windows Vista (under XP and below, many services ran asLocalSystemand could interact with the desktop: a bad combination from a security point of view):
Q
I found information online which suggests lauching the CMD.exe using the DOS Task Scheduler AT command, but I received a Vista warning that “due to security enhancements, this task will run at the time excepted but not interactively.” Here’s a sample command:AT 12:00 /interactive cmd.exeAnother solution suggested creating a secondary Windows Service via the Service Control (sc.exe) which merely launches CMD.exe.C:\sc create RunCMDAsLSA binpath= "cmd" type=own type=interact C:\sc start RunCMDAsLSAIn this case the service fails to start and results it the following error message:FAILED 1053: The service did not respond to the start or control request in a timely fashion.A
I came across this article which demonstrates the use of PSTools from SysInternals (which was acquired by Microsoft in July, 2006.) I launched the command line via the following and suddenly I was running under the Local Admin Account like magic:psexec -i -s cmd.exePSTools works well. It’s a lightweight, well-documented set of tools which provides an appropriate solution to my problem.C
I like this better with
-dadded, so that I can continue to use the console I launched it from.A
- Download psexec.exe from Sysinternals.
- Place it in your
C:\drive. - Logon as a standard or admin user and use the following command:
cd \. This places you in the root directory of your drive, where psexec is located. - Use the following command:
psexec -i -s cmd.exewhere-iis for interactive and-sis for system account. - When the command completes, a cmd shell will be launched. Type
whoami; it will say ‘system” - Open taskmanager. Kill explorer.exe.
- From an elevated command shell type
start explorer.exe. - When explorer is launched notice the name “system” in start menu bar. Now you can delete some files in system32 directory which as admin you can’t delete or as admin you would have to try hard to change permissions to delete those files.
(actually
whoamishowsNT Authority\System)C
To allow interactive services for Server 2012,
HKLM\SYSTEM\CurrentControlSet\Control\Windows\NoInteractiveServicesneed to set as 0 (Default 1) MSDN: Interactive servicesThanks [Wayback/Archive] Ben Griswold, [Wayback/Archive] SamB, [Wayback/Archive] raven and [Wayback/Archive] Ivan Chau.
- [Wayback/Archive] Running a CMD prompt as System (XP/Vista/Win7/Win8) « The Realm of the Verbal Processor
- [Wayback/Archive] Sysinternals – Sysinternals | Microsoft Learn
- [Wayback/Archive] PsExec – Sysinternals | Microsoft Learn with this subset of parameters
…
Parameter Description -d Don’t wait for process to terminate (non-interactive). -i Run the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session. This flag is required when attempting to run console applications interactively (with redirected standard IO). -s Run the remote process in the System account. …
Run Regedit interactively in the System account to view the contents of theSAMandSECURITYkeys:psexec -i -d -s c:\windows\regedit.exe…
PsExec is part of a growing kit of Sysinternals command-line tools that aid in the administration of local and remote systems named PsTools.
- [Wayback] download.sysinternals.com/files/PSTools.zip contains
PsExec.exe.
- [Wayback/Archive] PsExec – Sysinternals | Microsoft Learn with this subset of parameters
- [Wayback/Archive] LocalSystem Account – Win32 apps | Microsoft Learn
- [Wayback/Archive] Interactive Services – Win32 apps | Microsoft Learn
Services running in an elevated security context, such as the LocalSystem account, should not create a window on the interactive desktop because any other application that is running on the interactive desktop can interact with this window. This exposes the service to any application that a logged-on user executes. Also, services that are running as LocalSystem should not access the interactive desktop by calling the OpenWindowStation or GetThreadDesktop function.
Note that running as LocalSystem can be extremely dangerous as it is the highest security level on your computer (that’s why viruses and trojans usually try to reach to run at this security level). In fact running as it basically makes you appear as your computer, even to other parts of the network. This can be even worse in a network with domain based security.
Queries
Some of the Google Search queries I used (I forgot to save all of them while figuring out the above solution) are below.
Note the ones about diskpart boot flag in various forms showing that I still had to get my mindset from MBR into GPT.
- [Wayback/Archive] Automatic Repair Automatic Repair couldn’t repair your PC Press “Advanced options” to try other options to repair your PC or “Shut down to turn off your PC. “WindowsRE” – Google Search
- [Wayback/Archive] diskpart site:learn.microsoft.com – Google Search
- [Wayback/Archive] bcdboot site:learn.microsoft.com – Google Search
- [Wayback/Archive] bcd registry file – Google Search
- [Wayback/Archive] site:https://thestarman.pcministry.com/asm/mbr – Google Search
- [Wayback/Archive] runas system account – Google Search
- [Wayback/Archive] windows console dump bcd – Google Search
- [Wayback/Archive] “Automatic Repair” “Advanced options” – Google Search
- [Wayback/Archive] “the active command can only be used on fixed mbr” “gpt” – Google Search
- [Wayback/Archive] diskpart make disk and partition bootable – Google Search
- [Wayback/Archive] diskpart list active disk and partition – Google Search
- [Wayback/Archive] superuser windows 10 repair boot system esp diskpart – Google Search
- [Wayback/Archive] diskpart set boot flag – Google Search
- [Wayback/Archive] diskpart set boot flag site:superuser.com – Google Search
- [Wayback/Archive] “diskpart” “boot” “flag” – Google Search
- [Wayback/Archive] uefi windows 10 boot repair – Google Search
- [Wayback/Archive] windows list boot entries – Google Search
- [Wayback/Archive] bfsvc warning failed to forcibly unload the system store – Google Search
- [Wayback/Archive] “BFSVC Warning: Failed to forcibly unload the system store. Status = [c000000e]” – Google Search
- zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Image search: [Wayback/Archive] Automatic Repair Automatic Repair couldn’t repair your PC Press “Advanced options” to try other options to repair your PC or “Shut down to turn off your PC. “WindowsRE” – Google Search
Tweets
I summarised the above in a short [Wayback/Archive] Thread by @jpluimers on Thread Reader App which started at [Wayback/Archive] Jeroen Wiert Pluimers @wiert@mastodon.social on Twitter: “Dang. Didn’t know that bootcfg would add another boot entry instead of overwriting the current one. Also: I added the top one as C:\Windows, so why does the boot manager not show that anywhere?”.
The response to try out EasyBCD looks interesting. Not for this case (where I needed to solve it from the WindowsRE session), but in case I ever want to create a multi-boot system to test various operating systems on real hardware instead of virtualised hardware:
[Wayback/Archive] Meik Tranel on Twitter: “@jpluimers Drive letters are local to your boot, you can rename different boot options if you really intended for two different boots, but the MBR has no concept of disks or drive letters. It just lists entries that themselves have references to disks. I always use EasyBCD.”
–jeroen







Leave a comment