Bcdboot command in Windows
The bcdboot command allows you to quickly set up the system partition, or to repair the boot environment on the system partition. The system partition is established by copying a simple set of Boot Configuration Data (BCD) files into an existing empty partition.
For more information about BCDboot, including information on where to find the BCDboot command and examples of how to use this command, see the BCDboot command-line options .
Bcdboot command in Windows
- Syntax
- Parameters
- BCDboot command line options
- File locations
- Supported operating system
- How does BCDboot work?
- Command line options
- Repair system partition
- Set up or repair boot menu on dual boot PC
Syntax
bcdboot [/ l] [/ s]
Parameters
Parameter Description Source Specifies the location of the Windows directory to use as the source for copying the boot environment files. / l Specify language. The default language is American English. / s Specifies the letter for the system partition. By default, the system partition is defined by the firmware.BCDboot command line options
Applies to : Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2.
As mentioned above, the BCDboot tool is a command line tool that allows you to manage system partition files. You can use this tool in the following cases:
- Set up boot files on the system partition when you deploy new computers.
- Set up Windows to boot into a Virtual hard disk file (VHD).
- Repair system partition. If the system partition is corrupted, you can use BCDboot to recreate the system partition files using new copies of these files from the Windows partition.
- Set up or repair boot menu on dual boot computer. If you have installed multiple copies of Windows on your PC, you can use BCDboot to add or repair the boot menu.
File locations
BCDboot.exe file can be in one of the following locations:
In Windows PE 3.x and Windows PE 4.x:
% WINDIR% System32
In Windows 8, Windows 7, Windows Server 2012 and Windows Server 2008 R2:
% WINDIR% System32
In the Windows Assessment and Deployment Kit (Windows ADK):
C: Program Files (x86) Windows Kits8.1Assessment and Deployment KitDeployment Toolsamd64BCDBoot
Supported operating system
BCDboot can copy files in the boot environment from images of Windows 8.1, Windows 8, Windows 7, Windows Vista, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 or Windows Server 2008.
How does BCDboot work?
To configure the system partition, BCDboot copies a small set of files in the boot environment, from the installed Windows image to the system partition. Next, BCDboot creates a Boot Configuration Data (BCD) store on the system partition indicating the computer to boot into the Windows partition. On UEFI-based computers, BCDBoot adds a firmware entry in NVRAM to point to these boot files.
BCDboot uses the % WINDIR% System32ConfigBCD-Template file to create a new BCD store and initialize BCD boot environment files on the system partition. You can specify specific BCD settings in the BCD-Template file . The BCDboot tool also copies the most recent version of the boot files from the % WINDIR% operating system image directory to the system partition.
BCDboot can update the existing boot environment on the system partition:
- BCDboot copies newer versions of files from Windows images to the system partition.
- If a BCD store already exists on the system partition, BCDboot will create a new boot entry in the existing BCD store, based on the settings in the BCD-Template file.
- If there is already a boot entry for this Windows partition, BCDboot by default will delete the old boot entry and its values. To retain values from an existing boot entry when you update the system files, you can use the / m option with the BDCBoot.exe command .
Command line options
BCDboot.exe has the following command line options:
BCDBOOT [/ l] [/ s [/ f]] [/ v] [/ m [{OS Loader GUID}]]Optional Description
Necessary. Specify the location of the Windows directory to use as the source of copying files in the boot environment.
The following example initializes the system partition using BCD files from folder C: Windows:
bcdboot C:Windows
/ l
Optional. Specify language. The default is American English (en-us).
The following example sets the default BCD language to Japanese:
bcdboot C:Windows /l ja-jp
/S
Optional. Specify the volume volume of the system partition. This option should not be used in typical deployment scenarios.
Use this setting to specify the system partition when you configure the drive to be booted on another computer, such as a USB flash drive or a secondary hard drive.
UEFI :
- BCDBoot copies boot files to the EFI system partition or the partition specified by / s.
- BCDBoot creates a BCD store in the same partition.
- By default, BCDboot creates a Windows Boot Manager entry in NVRAM on the firmware, to identify boot files on the system partition. If the / s option is used, then this item is not created. Instead, BCDboot relies on the default firmware settings, to identify boot files on the system partition. According to UEFI 2.3.1 parameters, the default firmware installation will open the file: efibootbootx64.efi in EFI System Partition (ESP).
BIOS :
- BCDBoot copies boot files to the active partition on the main hard drive or partition specified by / s.
- BCDBoot creates BCD store in the same partition.
The following example copies BCD files from folder C: Windows to a system partition on the secondary hard drive, which will be booted on another computer. The system partition on the secondary drive is assigned the letter s :
bcdboot C:Windows /s S:
The following example creates boot entries on a USB flash drive with the letter F, including boot files to support UEFI-based or BIOS-based computers:
bcdboot C:Windows /s F: /f ALL
/ f
Optional. Specify the firmware type. Valid values include UEFI, BIOS and ALL.
- On BIOS / MBR-based systems, the default value is BIOS. This option creates the Boot folder on the system partition and copies all necessary boot environment files into this directory.
- On UEFI / GPT-based systems, the default value is UEFI. This option creates the EfiMicrosoftBoot folder and copies all necessary boot environment files into this directory.
- When you specify ALL values, BCDboot creates both the Boot and EfiMicrosoftBoot directories as well as copies all the boot environment files needed for the BIOS and UEFI into these directories.
If you specify the / f option , you must also specify the / s option to specify the drive letter of the system partition.
The following example copies BCD files that support booting on the computer, based on UEFI or BIOS-based from the folder C: Windows to the USB flash drive assigned the letter F:
bcdboot C:Windows /s F: /f ALL
/ v
Optional. Activate verbose mode. For example:
bcdboot C:Windows /v
/ m [ {OS Loader GUID} ]
Optional. Merge values from an existing boot entry into a new boot entry.
By default, this option only merges common objects. If you specify an OS Loader GUID, this option combines the loader object in the system template, to create a bootable item.
The following example merges the operating system loader in the current BCD store, but the GUID specified in the new BCD store is:
bcdboot c:Windows /m {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
Repair system partition
If the system partition is corrupted, you can use BCDboot to recreate the system partition files, using new copies of these files from the Windows partition.
1. Start the PC with a command line. For example, boot into Windows installation disc and press Shift + F10 or boot into Windows PE.
2. Use Diskpart to determine which drive letter contains your Windows partition and system partition.
diskpart, list vol, exit
3. Optional: Format your system partition:
format (drive letter của phân vùng hệ thống) / q
4. Add a boot entry for the Windows partition:
bcdboot D: Windows
5. Windows will appear, after restarting the PC.
Set up or repair boot menu on dual boot PC
When setting up a PC to start multiple operating systems, you can sometimes lose the ability to boot into one of the operating systems. The BCDBoot option allows you to quickly add boot options to the Windows operating system. To set up dual-boot PC:
1. Install a separate hard drive or prepare a separate partition for each operating system.
2. Install the operating system. For example, if your PC has Windows 7, install Windows 8.1 on your hard drive or other partition.
3. Restart the PC. Boot menus will appear with both operating systems listed.
If both operating systems are not listed:
a. Open a command line, as an admin from within Windows, or by starting a command line using the Windows installation disk and pressing Shift + F10 , or by starting Windows PE.
b. Added option to boot for Windows operating system.
Bcdboot D: Windows
c. Restart the PC. Now, the boot menu will display both menu options.
See more:
- The autochk command in Windows
- The atmadm command in Windows
- Auditpol command in Windows
You should read it
- Del command in Windows
- Set command in Windows
- Doskey command in Windows
- Cmd command in Windows
- Command at in Windows
- The chkntfs command in Windows
- Fc command in Windows
- The echo command in Windows
- Bitsadmin getdisplayname and bitsadmin geterror command in Windows
- The command reg add in Windows
- Rem command in Windows
- Reg command copy in Windows
Maybe you are interested
How to Enable and Disable Tabs in File Explorer on Windows 11
5 macOS Sequoia Features Not Available on Windows 11
Why does Windows operating system have such a bad reputation?
Quickly fix Unmountable Boot Volume error on Windows 10/11
15 safe software and application download websites for Windows
How to Fix Clipboard History Error in Windows 11 Latest Update