BCDBoot命令行参数选项

BCDBoot命令行参数选项BCDBootComma LineOptions BCDBootisaco linetoolused Youcanusethe

BCDBoot Command-Line Options

  • 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.

    File Locations

    In Windows and Windows Preinstallation Environment (WinPE)

    %WINDIR%\System32\BCDBoot.exe

    In the Windows Assessment and Deployment Kit (Windows ADK):

    C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\BCDBoot\BCDBoot.exe

    Supported operating systems

    BCDBoot can copy boot environment files from images of Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista, Windows Server 2016 Technical Preview, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, or Windows Server 2008.

    How It Works

    To configure the system partition, BCDBoot copies a small set of boot-environment files from the installed Windows image to the system partition.

    BCDBoot can create a Boot Configuration Data (BCD) store on the system partition using the latest version of the Windows files:

    • BCDBoot creates a new BCD store and initialize the BCD boot-environment files on the system partition, including the Windows Boot Manager, using the %WINDIR%\System32\Config\BCD-Template file.
    • New in Windows 10: During an upgrade, BCDBoot preserves any other existing boot entries, such as debugsettings, when creating the new store. Use the /c option to ignore the old settings and start fresh with a new BCD store.
    • If there is already a boot entry for this Windows partition, by default, BCDBoot erases the old boot entry and its values. Use the /m option to retain the values from an existing boot entry when you update the system files.
    • By default, BCDBoot moves the boot entry for the selected Windows partition to the top of the Windows Boot Manager boot order. Use the /d option to preserve the existing boot order.

    On UEFI PCs, BCDBoot can update the firmware entries in the device’s NVRAM:

    • BCDBoot adds a firmware entry in the NVRAM to point to the Windows Boot Manager. By default, this entry is placed as the first item in the boot list. Use the /p option to preserve the existing UEFI boot order. Use /addlast to add it to the bottom of the boot order list.

    Command-Line Options

    The following command-line options are available for BCDBoot.exe.

    BCDBOOT <source> [/l <locale>] [/s <volume-letter> [/f <firmware type>]] [/v] [/m [{
    OS Loader GUID}]] [/addlast or /p] [/d] [/c]

    Option Description

    Required. Specifies the location of the Windows directory to use as the source for copying boot-environment files.

    The following example initializes the system partition by using BCD files from the C:\Windows folder:

    Copy

    bcdboot C:\Windows

    /l 

    Optional. Specifies the locale. The default is US English (en-us).

    The following example sets the default BCD locale to Japanese:

    Copy

    bcdboot C:\Windows /l ja-jp

    /s 

    Optional. Specifies the volume letter of the system partition. This option should not be used in typical deployment scenarios.

    Use this setting to specify a system partition when you are configuring a drive that will be booted on another computer, such as a USB flash drive or a secondary hard drive.

    UEFI:

    • BCDBoot copies the boot files to either the EFI system partition, or the partition specified by the /s option.

      BCDBoot creates the BCD store in the same partition.

      By default, BCDBoot creates a Windows Boot Manager entry in the NVRAM on the firmware to identify the boot files on the system partition. If the /s option is used, then this entry is not created. Instead, BCDBoot relies on the default firmware settings to identify the boot files on the system partition. By the UEFI 2.3.1 spec, the default firmware settings should open the file: \efi\boot\bootx64.efi in the EFI System Partition (ESP).

    BIOS:

    1. BCDBoot copies the boot files to either the active partition on the primary hard drive, or the partition specified by the /s option.
    2. BCDBoot creates the BCD store in the same partition.

    The following example copies BCD files from the C:\Windows folder to a system partition on a secondary hard drive that will be booted on another computer. The system partition on the secondary drive was assigned the volume letter S:

    Copy

    bcdboot C:\Windows /s S:

    The following example creates boot entries on a USB flash drive with the volume letter S, including boot files to support either a UEFI-based or a BIOS-based computer:

    Copy

    bcdboot C:\Windows /s S: /f ALL

    /f 

    Optional. Specifies the firmware type. Valid values include UEFIBIOS, and ALL.

    • On BIOS/MBR-based systems, the default value is BIOS. This option creates the \Boot directory on the system partition and copies all required boot-environment files to this directory.
    • On UEFI/GPT-based systems, the default value is UEFI. This option creates the \Efi\Microsoft\Boot directory and copies all required boot-environment files to this directory.
    • When you specify the ALL value, BCDBoot creates both the \Boot and the \Efi\Microsoft\Boot directories, and copies all required boot-environment files for BIOS and UEFI to these directories.

    If you specify the /f option, you must also specify the /s option to identify the volume letter of the system partition.

    The following example copies BCD files that support booting on either a UEFI-based or a BIOS-based computer from the C:\Windows folder to a USB flash drive that was assigned the volume letter S:

    Copy

    bcdboot C:\Windows /s S: /f ALL 

    /v

    Optional. Enables verbose mode. Example:

    Copy

    bcdboot C:\Windows /v

    /m [{OS Loader GUID}]

    Optional. Merges the values from an existing boot entry into a new boot entry.

    By default, this option merges only global objects. If you specify an OS Loader GUID, this option merges the loader object in the system template to produce a bootable entry.

    The following example merges the operating-system loader in the current BCD store that the specified GUID identifies in the new BCD store:

    Copy

    bcdboot c:\Windows /m {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

    /addlast

    Optional. Specifies that the Windows Boot Manager firmware entry should be added last. The default behavior is to add it first. Cannot be used with /p.

    Copy

    bcdboot C:\Windows /addlast

    /p

    Optional. Specifies that the existing Windows Boot Manager firmware entry position should be preserved in the UEFI boot order. If entry does not exist, a new entry is added in the first position. Cannot be used with /addlast.

    By default, during an upgrade BCDBoot moves the Windows Boot Manager to be the first entry in the UEFI boot order.

    Copy

    bcdboot C:\Windows /p bcdboot C:\Windows /p /d

    /d

    Optional. Preserves the existing default operating system entry in the {bootmgr} object in Windows Boot Manager.

    Copy

    bcdboot C:\Windows /d

    /c

    Optional. Specifies that any existing BCD elements should not be migrated.

    New for Windows 10: By default, during an upgrade, BCD elements such as debugsettings or flightsigning are preserved.

    Copy

    bcdboot C:\Windows /c

    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.

    1. Boot your PC to a command line. For example, boot to the Windows installation disk and press Shift+F10, or boot to Windows PE (WinPE: Create USB Bootable drive).
    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 of your system partition) /q
    4. Add a boot entry for your Windows partition: bcdboot D:\Windows
    5. Reboot the PC. Windows should appear.

    Set up or repair the boot menu on a dual-boot PC

    When setting up a PC to boot more than one operating system, you may sometimes lose the ability to boot into one of the operating systems. The BCDBoot option allows you to quickly add boot options for a Windows-based operating system. To set up a dual-boot PC:

    1. Install a separate hard drive or prepare a separate partition for each operating system.
    2. Install the operating systems. For example, if your PC has Windows 7, install Windows 10 onto the other hard drive or partition.
    3. Reboot the PC. The boot menus should appear with both operating systems listed.

      If both operating systems aren’t listed:

      1. Open a command line, either as an administrator from inside Windows, or by booting to a command line using the Windows installation media and pressing Shift+F10, or by booting to Windows PE (WinPE: Create USB Bootable drive).
      2. Add boot options for a Windows operating system.

        Copy

        bcdboot D:\Windows 
      3. Reboot the PC. Now, the boot menu will show both menu options.

    Troubleshooting

    For information about repairing the boot files on a PC with Windows XP and a more recent version of Windows such as Windows 7, see the Microsoft Knowledge Base Article .

    Capture and Apply Windows, System, and Recovery Partitions

    Configure BIOS/MBR-Based Hard Drive Partitions

    Configure UEFI/GPT-Based Hard Drive Partitions

    BCDedit

    Bootsect Command-Line Options

    Diskpart Command line syntax

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/220832.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 下午7:32
下一篇 2026年3月17日 下午7:33


相关推荐

  • mysql 替换某个字段中的某个字符

    mysql 替换某个字段中的某个字符

    2021年10月21日
    46
  • Mybatis 拦截器简述[通俗易懂]

    Mybatis 拦截器简述[通俗易懂]一、Mybatis拦截器可以做到什么慢查询,SQL异常监控数据预处理(加密,自生成字段)数据脱敏数据权限过滤二、MybatisSQL执行流程这里重点关注InterceptorChain,它会为Mybatis的四大对象织入代理。我们自定义生成的拦截器也将通过InterceptorChain织入。三、Mybatis拦截器使用方式拦截粒度为方法签名自定义拦截器需使用@Intercepts和@Signature注解来指定拦截类和方法。例如拦截Exceptor的query和update

    2025年10月9日
    4
  • 最长递增子序列的三种算法

    最长递增子序列的三种算法转载自:http://qiemengdao.iteye.com/blog/1660229最长递增子序列 问题给定一个长度为N的数组,找出一个最长的单调自增子序列(不一定连续,但是顺序不能乱)。例如:给定一个长度为6的数组A{5,6,7,1,2,8},则其最长的单调递增子序列为{5,6,7,8},长度为4.解法1:最长公共子序列法这个问题

    2022年4月29日
    56
  • zoom:1是什么意思

    zoom:1是什么意思

    2021年9月20日
    101
  • Bootstrap4 glyphicon 移除图标 glyphicon fonts-faces 解决方案

    Bootstrap4 glyphicon 移除图标 glyphicon fonts-faces 解决方案bootrap3 是支持的图标 4 不支持 4 已经移除了收费图标 取而代之建议使用其他的 比如 https octicons github com 和 http fontawesome io 但是 3 和 4 我都用过的 直接扣下了 3 里面的部分 如图目录结构 您可以将一下代码 copy 到您引入的 bootstrap 4 0 0 dist css bootstrap css 文件中

    2026年3月18日
    3
  • IIS日志分析工具

    IIS日志分析工具日志分析工具有很多 所以对于新手来说 选择一款合适的工具便显得尤其复杂 https www iis net downloads

    2025年11月7日
    4

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号