Softcoria

How to Use bcdboot to Repair Windows Boot Files in WinRE

By Editorial Team · Nov 4, 2026

When Windows cannot start because its boot files or Boot Configuration Data (BCD) are missing or damaged, the bcdboot command can help rebuild the boot environment without reinstalling Windows.
You can run bcdboot from the Windows Recovery Environment (WinRE), identify your Windows and system partitions, and copy fresh boot files to the correct location. The important part is choosing the right Windows drive letter, system partition, and firmware mode.
This guide explains what bcdboot does, how its switches work, and how to use it safely on UEFI and legacy BIOS computers.

What Is bcdboot?


bcdboot is a Windows command-line utility that copies boot-environment files from an existing Windows installation to the system partition and initializes the Boot Configuration Data (BCD) store.
Windows needs these files to start the operating system. On a UEFI computer, they normally reside on the EFI System Partition (ESP). On a traditional BIOS computer, they reside on the active system partition.
BCDBoot can:
Recreate missing or damaged Windows boot files on an existing system partition.
Initialize a new BCD store using files from the Windows installation.
Repair Windows Boot Manager configuration.
Add Windows boot options to a dual-boot configuration.
Register a Windows Boot Manager firmware entry in UEFI NVRAM when its automatic firmware-handling behavior is used.
Important: bcdboot does not rewrite the Master Boot Record (MBR) or the partition's boot-sector code. It works with boot-environment files and BCD configuration. If the actual MBR or boot sector is damaged, a different repair tool may be necessary.

bcdboot Syntax and Command-Line Switches


The main syntax for the repair-related options is:
bcdboot <source> [/l <locale>] [/s <volume-letter> [/f <firmware type>]] [/v] [/m [{OS Loader GUID}]] [/addlast | /p] [/d] [/c]
The required <source> argument identifies the Windows directory containing the boot files. Everything else is optional and changes where files are copied or how boot entries are handled.

The source argument


The source is the Windows directory from which BCDBoot copies the boot-environment files.
For example:
bcdboot C:\Windows
This example assumes the Windows installation is on C:. In WinRE, the same installation might be assigned D:, E:, or another letter. Always verify the actual location before running the command.

/s — Specify the system partition


The /s switch identifies the target system partition by its drive letter.
For example:
bcdboot C:\Windows /s S:
Here, S: represents the partition that will receive the boot files.
Use the correct target:
UEFI: the EFI System Partition, normally formatted as FAT32.
BIOS: the system partition used to start Windows, normally the active partition on an MBR disk.
There is an important side effect when using /s on UEFI computers: BCDBoot does not create a new Windows Boot Manager entry in firmware NVRAM. It copies the files to the specified partition and relies on the firmware's default boot behavior.
This distinction matters when the boot files are present but the firmware still does not show Windows Boot Manager.

/f — Select the firmware type

The /f switch specifies the firmware type for which BCDBoot should prepare boot files.
There are three accepted values:
/f UEFI creates the UEFI boot-file directory, \EFI\Microsoft\Boot.
/f BIOS creates the BIOS boot-file directory, \Boot.
/f ALL creates both directories and copies the required files for both firmware types.
Examples:
bcdboot C:\Windows /s S: /f UEFI
bcdboot C:\Windows /s S: /f BIOS
bcdboot C:\Windows /s S: /f ALL
Note: Microsoft requires /s when /f is specified. Choose UEFI or BIOS according to the computer's actual boot configuration. Use ALL when you intentionally need both sets of boot files on a suitable target, such as a removable boot device. It is not a universal fix for a firmware-mode mismatch.

/l — Set the boot environment locale

The /l switch specifies the language and locale used when initializing the BCD environment.
For example:
bcdboot C:\Windows /l en-US
The default locale is US English. Most users can leave this switch out unless they need a different boot environment language.
/v — Enable verbose output
The /v switch enables verbose mode, which displays additional information while BCDBoot runs.
Example:
bcdboot C:\Windows /v
It is useful when troubleshooting a failed operation because it provides more detail than the normal command output.
/m — Merge an existing Windows boot entry
The /m switch merges values from an existing boot entry into a new entry.
Without a specified GUID, it merges global objects. With an OS Loader GUID, it also merges the identified operating-system loader entry.
Example:
bcdboot C:\Windows /m {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
This option is useful when rebuilding boot files while retaining configuration from an existing Windows installation. The GUID must identify the correct loader entry in the BCD store.
It is particularly worth considering when maintaining an existing Windows boot configuration rather than creating a completely fresh one.
/addlast — Add Windows Boot Manager at the end
The /addlast switch places the Windows Boot Manager firmware entry at the end of the UEFI boot order instead of moving it to the first position.
Example:
bcdboot C:\Windows /addlast
This can help when another operating system or boot manager should retain priority.
You cannot combine /addlast with /p.
/p — Preserve the existing UEFI firmware boot order
The /p switch preserves the existing position of the Windows Boot Manager entry in the UEFI firmware boot order.
Example:
bcdboot C:\Windows /p
If the firmware entry does not already exist, BCDBoot adds it in the first position.
This option is useful when repairing Windows on a computer that also uses other boot options. Remember that /p and /addlast cannot be used together.
/d — Preserve the default operating system selection
The /d switch preserves the existing default operating system entry in the Windows Boot Manager configuration.
Example:
bcdboot C:\Windows /d
This is different from /p: /d concerns the default operating system entry inside the BCD configuration, while /p concerns the position of Windows Boot Manager in the UEFI firmware boot order.
/c — Start without migrating existing BCD settings
The /c switch tells BCDBoot not to migrate existing BCD elements from the current configuration.
Example:
bcdboot C:\Windows /c
This is useful when deliberately starting with fresh boot configuration settings. However, it can discard configuration you intended to retain.
For ordinary boot repair, do not add /c automatically. Consider it only when there is a specific reason to discard the existing migrated settings.
/bcdclean — Clean existing BCD entries
You may encounter /bcdclean in some versions of the BCDBoot command-line help or older command references.
It is described there as a way to remove duplicate BCD entries. The optional full argument is described as additionally removing entries whose associated devices cannot be found.
However, /bcdclean is not included in Microsoft's current published BCDBoot Command-Line Options reference (https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/bcdboot-command-line-options-techref-di?view=windows-11). Its documented behavior and availability across current Windows versions therefore cannot be confirmed from that reference.
To see which options your own Windows installation exposes, run:
bcdboot /?
Do not treat /bcdclean as a standard replacement for repairing boot files. Back up your BCD before experimenting with cleanup options, particularly on a dual-boot computer.

Before You Run bcdboot: Safety Checklist

BCDBoot is a targeted repair utility, but it changes the computer's boot configuration. Check these points before running it.
Back up the existing BCD store
If you can still access an elevated Command Prompt in your installed Windows environment, export the system BCD store:
bcdedit /export D:\BCD-backup
Replace D: with another writable location where you want to keep the backup.
The /export operation backs up the active system store. Running it from WinRE does not automatically mean you are backing up the offline Windows installation's BCD store. If Windows cannot start, first identify the actual system partition and copy its existing BCD file to a safe location before replacing it.
For example, on a UEFI installation:
copy S:\EFI\Microsoft\Boot\BCD D:\BCD-backup
On a BIOS installation, the store is normally under S:\Boot\BCD.
If the file does not exist, there may be no existing store to copy.
Confirm the firmware mode
Check whether the computer uses UEFI or legacy BIOS before selecting /f.
If Windows still starts, System Information (msinfo32) displays the BIOS Mode value. Otherwise, check the firmware setup screen and how the computer is configured to boot.
Do not assume that every PC uses UEFI simply because it is relatively new.
Have your BitLocker recovery key available
WinRE may request the BitLocker recovery key before allowing access to an encrypted Windows installation.
Make sure you can retrieve the key before beginning manual recovery.
Will bcdboot delete my personal files?
The normal bcdboot repair command does not format the Windows partition or erase personal files. Its purpose is to copy boot-environment files and initialize or update boot configuration on the system partition.
However, it changes boot settings. Avoid combining it with formatting, partition deletion, or other destructive DiskPart commands unless you have confirmed exactly what those operations will affect.
Will bcdboot break a dual-boot menu?
It can change the position or configuration of Windows boot entries. The default behavior may move the selected Windows entry to the top of the Windows Boot Manager order.
You can reduce unwanted changes by selecting the appropriate switches:
/m merges existing boot-entry values into the new entry.
/d preserves the default operating system selection.
/p preserves the existing UEFI firmware boot order.
/addlast puts the Windows Boot Manager firmware entry at the end instead.
Do not use /p and /addlast together. Also remember that /s suppresses the creation of a new UEFI NVRAM entry, so firmware-order switches do not provide a replacement for that missing registration.
These options help manage Windows boot entries, but they are not a guarantee that every third-party boot manager or custom boot configuration will remain unchanged. Keep a backup and record your existing firmware boot order.

The WinRE Drive-Letter Trap: Find the Correct Windows Drive

One of the most common reasons for a failed bcdboot repair is using the wrong Windows drive letter.
A Windows installation that normally appears as C: in File Explorer may appear as D: or E: in the Recovery Environment. WinRE and Windows PE assign drive letters according to the volumes they detect in that particular environment.
The letter X: is commonly reserved for the running recovery environment, not your installed Windows system.
Use DiskPart to identify the volumes
Open Command Prompt in WinRE and enter:
diskpart
list vol
Look at the volume list. Identify the likely Windows volume by its size, label, and filesystem. The Windows partition normally uses NTFS.
The system partition is separate:
UEFI installations use an EFI System Partition formatted as FAT32.
BIOS installations typically use a separate system partition containing the boot files.
If you are unsure which volume contains Windows, exit DiskPart and check the likely letters:
exit
dir C:\Windows
dir D:\Windows
dir E:\Windows
The correct directory should contain the installed Windows system files.
Use that letter in the source argument. For example, if Windows is actually on D:, your command must start with bcdboot D:\Windows, not bcdboot C:\Windows.
Assign a letter to the EFI or system partition
The EFI System Partition is usually hidden and has no drive letter.
If you have identified the correct disk and partition, assign it a temporary letter:
diskpart
list disk
select disk <disk-number>
list partition
select partition <EFI-partition-number>
assign letter=S
exit
Replace the placeholders with the numbers shown on your computer.
Do not select a partition just because it is small. Confirm that it is the actual EFI System Partition. On a normal UEFI installation, it should be a FAT32 system partition on the GPT disk.
For a legacy BIOS installation, identify the correct system partition instead. It is commonly an NTFS System Reserved partition or another designated boot partition.

How to Repair Windows Boot Files with bcdboot in WinRE

The following walkthrough assumes that Windows is still present on the disk and that the correct system partition exists.
Step 1: Enter Windows Recovery Environment
You can enter WinRE through Automatic Repair after repeated unsuccessful starts, through the recovery options available on a working Windows installation, or by booting from Windows installation media.
If using installation media:
Start the computer from the Windows USB drive.
Select your language and keyboard preferences.
Choose the repair option rather than starting a new installation.
Open Troubleshoot.
Select Advanced options.
Open Command Prompt.
If asked, provide the BitLocker recovery key.
Step 2: Find the Windows installation
Run:
diskpart
list vol
Find the partition containing Windows, then exit DiskPart and verify the directory.
For example:
dir D:\Windows
If you see the Windows system directories, D: is the correct source letter for this example.

Step 3: Identify and assign the system partition

For a UEFI system, locate the FAT32 EFI System Partition and assign it S:.
For a BIOS system, locate the correct system partition instead.
Use the DiskPart procedure described above. Make sure S: is not already being used by another volume.
Step 4: Run the UEFI repair command
For a computer installed in UEFI mode, run:
bcdboot D:\Windows /s S: /f UEFI
Replace D: if your Windows installation has a different letter.
This copies the UEFI boot files from the installed Windows directory to the specified EFI System Partition and initializes its BCD store.
Step 5: Use the BIOS variant when appropriate
For a legacy BIOS/MBR installation, use:
bcdboot D:\Windows /s S: /f BIOS
In this example, S: must identify the correct BIOS system partition. It is not an EFI System Partition.
The BIOS system partition must also be the correct active boot partition for the firmware to start Windows.
Step 6: Check the result and restart
A successful operation should report that the boot files were created successfully.
Close Command Prompt, return to the recovery menu, and restart the PC. Remove the installation USB if necessary so the computer attempts to start from its internal drive.
A success message means the copy operation completed. It does not guarantee that the firmware can locate the resulting boot files; see the verification section below.

How to Fix "Failure When Attempting to Copy Boot Files"

This error indicates that BCDBoot could not complete its boot-file operation. It is not a precise diagnosis of one particular hardware or partition problem.
Check the source path, destination partition, filesystem, and firmware configuration before repeating the command.
1. The BIOS system partition is not active
On a legacy BIOS/MBR installation, the computer needs the correct active system partition to start Windows.
Microsoft documents that BCDBoot uses the active partition on the primary hard drive as the normal BIOS system-partition target.
To inspect or mark the correct partition active, use DiskPart:
diskpart
select disk 0
list partition
select partition <system-partition-number>
active
exit
Warning: Only do this after confirming that the selected partition is the correct BIOS system partition on the appropriate MBR disk. Marking the wrong partition active can prevent Windows from starting.
Do not use active as an EFI repair step on a normal UEFI/GPT installation.
2. The firmware mode does not match the command
A computer configured for UEFI needs UEFI boot files. A legacy BIOS installation needs BIOS boot files.
Check the actual firmware configuration and use the matching command:
bcdboot D:\Windows /s S: /f UEFI
or:
bcdboot D:\Windows /s S: /f BIOS
Use /f ALL when you deliberately need both sets of boot files:
bcdboot D:\Windows /s S: /f ALL
Remember that ALL creates both boot-file directory structures. It does not convert an MBR disk into GPT, create an EFI partition, or automatically resolve an incompatible partition layout.
3. The EFI System Partition is missing or damaged
A UEFI Windows installation requires an EFI System Partition. Microsoft specifies that the ESP must use FAT32.
There are two different situations:
The partition exists, but its boot files are missing or damaged: Assign it a drive letter and use BCDBoot to recreate the boot files.
The partition itself has been deleted: BCDBoot cannot create the missing partition by itself. The disk must first be prepared with a correctly configured EFI System Partition.
Do not format another partition or create a replacement ESP without checking the disk layout and available space. Incorrect partition changes can make existing data inaccessible.
4. The MBR or boot-sector code is damaged
BCDBoot does not repair the MBR or rewrite the boot-sector code.
On a confirmed legacy BIOS/MBR system, a damaged MBR may require a separate repair:
bootrec /fixmbr
A damaged volume boot sector may require:
bootrec /fixboot
These commands address different layers of the boot process. Do not run them automatically on a UEFI/GPT installation just because BCDBoot failed.
5. The Windows source directory or target is incorrect
Check that the source contains a real Windows installation:
dir D:\Windows
Then confirm that S: is the intended system partition and is accessible.
Using the wrong Windows drive letter or assigning S: to a recovery, data, or unrelated partition can prevent BCDBoot from completing the operation.

When NOT to Use bcdboot

BCDBoot is useful for repairing boot files, but it is not the right solution for every computer that refuses to start.
The drive is dying or repeatedly failing
Do not repeatedly write boot files to a disk that is reporting I/O errors, disappearing from firmware, or showing signs of physical failure.
Prioritize recovering important data or making a disk image. Repair commands cannot correct a failing storage device.
The Windows installation itself is badly damaged
BCDBoot takes its boot files from the Windows directory you specify. It cannot repair a broken Windows installation simply by rebuilding the BCD store.
For example, if the required source files are missing or damaged within the installed Windows image itself, copying boot files from that same damaged source may not solve the problem.
Investigate the Windows image and system-file integrity first. Reinstalling Windows may eventually be necessary if the installation cannot be repaired. See our Windows 10 clean install guide (https://softcoria.com/guides/windows-10-clean-install/).

Startup Repair has already fixed the problem


If Startup Repair successfully resolves the startup failure and Windows starts normally, there is no reason to run BCDBoot just for the sake of rebuilding boot files.
Avoid making additional boot configuration changes to a system that is already working.

bcdboot vs Startup Repair: Which Should You Use?

Startup Repair and BCDBoot address startup problems in different ways.
Startup Repair is an automated WinRE tool. It checks for common problems, including damaged system files, BCD errors, and MBR damage, then attempts an appropriate repair.
BCDBoot is a more targeted command-line utility. You use it when you have identified the Windows installation and system partition and need to reconstruct the boot environment manually.
When Startup Repair is the better choice
Start with Startup Repair when:
Windows suddenly stops starting after an update or unexpected shutdown.
You do not know which part of the boot process is damaged.
You suspect a common BCD or startup-file problem.
You want Windows to attempt an automatic repair before using manual commands.
Microsoft's instructions are available in the Startup Repair guide (https://support.microsoft.com/en-us/windows/experience/startup-boot/startup-repair?nochrome=true).
When bcdboot can help where Startup Repair has not
BCDBoot is particularly useful when the problem has been narrowed down to boot-environment files or BCD configuration.
Examples include:
The boot files on an existing EFI System Partition have been removed or corrupted.
The BCD store on the system partition needs to be recreated from a working Windows installation.
A UEFI Windows Boot Manager firmware entry is missing and needs to be registered again.
A Windows installation needs to be added back to a dual-boot configuration.
One important distinction: a wiped ESP does not always mean the ESP partition itself is gone. If the partition still exists but its files have been erased, BCDBoot can recreate the files. If the partition has actually been deleted, you must restore the partition structure first.

How to Verify That bcdboot Actually Worked

Do not rely solely on the success message or the first restart. Check the boot files and configuration too.
Check that the boot files exist
For UEFI, inspect:
dir S:\EFI\Microsoft\Boot
For BIOS, inspect:
dir S:\Boot
The appropriate boot files and BCD store should be present.
Inspect the BCD store
For UEFI, run:
bcdedit /store S:\EFI\Microsoft\Boot\BCD /enum all
For BIOS:
bcdedit /store S:\Boot\BCD /enum all
Replace S: with the actual system-partition letter.
Review the output for the Windows Boot Manager and operating-system loader entries. Confirm that the configuration references the intended Windows installation rather than an unrelated or missing volume.
Check the UEFI NVRAM boot entry
On a UEFI computer, run:
bcdedit /enum firmware
Look for Windows Boot Manager in the firmware entries.
This check is especially important if you used /s.
The easily overlooked /s side effect: When you explicitly specify a system partition with /s, BCDBoot does not create a new UEFI NVRAM entry. It can therefore report successful file creation while the firmware still has no new Windows Boot Manager entry to select.
If the partition and boot files are correct but the firmware entry is missing, consider running BCDBoot without /s, after verifying that Windows and the intended ESP are correctly identified:
bcdboot D:\Windows
Without /s, BCDBoot can use the firmware-identified system partition and perform its normal UEFI NVRAM registration. Alternatively, the firmware setup utility may provide an option to add or select a UEFI boot entry.
Do not repeat this command blindly if the system partition is ambiguous or if the PC is configured for a different firmware mode.

bcdboot vs bootrec vs bootsect vs bcdedit

These four commands deal with different parts of Windows startup. Choosing the correct one is more useful than running all four together.
bcdboot
Use bcdboot to copy boot-environment files from a Windows installation to the system partition and initialize its BCD store.
It is the appropriate tool when the boot files or BCD configuration need to be recreated.
bootrec
Use Bootrec from WinRE for specific boot-record and BCD recovery operations.
Its commonly used commands include:
bootrec /fixmbr — repairs the master boot record.
bootrec /fixboot — writes a new boot sector.
bootrec /scanos — searches for Windows installations.
bootrec /rebuildbcd — searches for Windows installations and rebuilds the BCD configuration.
Bootrec is not interchangeable with BCDBoot. It addresses other boot-repair operations.
bootsect
Bootsect updates master boot code and volume boot code.
For example:
bootsect /nt60 SYS
The /nt60 option applies boot code compatible with Windows Boot Manager. Bootsect also has an /mbr option for updating the MBR without changing the partition table.
It is primarily relevant when repairing legacy boot-code problems, rather than rebuilding the files inside the EFI System Partition.
bcdedit
BCDEdit manages the contents of the BCD store.
You can use it to inspect boot entries, export the system BCD store, modify boot settings, and manage boot-menu configuration.
Examples:
bcdedit /enum all
bcdedit /export D:\BCD-backup
Use BCDEdit when you need to inspect or modify boot configuration data rather than copy a fresh set of boot-environment files.

Frequently Asked Questions

What does bcdboot do?
BCDBoot copies boot-environment files from an existing Windows installation to the system partition and initializes the BCD store. On UEFI computers, it can also register Windows Boot Manager in firmware NVRAM when used without /s.
It repairs boot configuration and boot files, not the MBR or volume boot-sector code.
How do I fix "Failure when attempting to copy boot files"?
First confirm that your Windows directory and target system partition are correct. Check the firmware mode, partition filesystem, and active-partition status if using legacy BIOS/MBR.
Use /f UEFI for a UEFI installation or /f BIOS for a legacy installation. Use /f ALL only when both boot-file sets are intentionally required. If the ESP is missing entirely or the MBR is damaged, additional partition or boot-record repair is necessary.
When do I use /f UEFI vs /f BIOS vs /f ALL?
Use /f UEFI for a UEFI installation with an EFI System Partition. Use /f BIOS for a legacy BIOS/MBR installation with the correct system partition. Use /f ALL when preparing a suitable system partition that must contain both types of boot files.
Remember that /f must be accompanied by /s.
Why isn't my Windows drive C: in WinRE — which letter do I use?
WinRE and Windows PE can assign drive letters differently from your normal Windows session. Your Windows installation might appear as D:, E:, or another letter.
Run diskpart followed by list vol, then exit DiskPart and check the likely Windows directories with dir D:\Windows or the appropriate letter. Use the drive that actually contains your installed Windows folder as the BCDBoot source.

Conclusion


BCDBoot is a useful tool when Windows boot files or the BCD store need to be reconstructed. The most important steps are identifying the correct Windows directory, selecting the right system partition, and matching the command to the PC's firmware mode.
For a typical UEFI recovery, the command is:
bcdboot D:\Windows /s S: /f UEFI
Replace D: and S: with the actual letters identified in WinRE. Remember that /s does not create a new UEFI NVRAM entry, so verify the firmware configuration if the computer still cannot find Windows Boot Manager.

Related guides

View all →