Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

Boot Process 與命令列工具BCDEdit用於管理 BCD (開機設定資料)存放區

提到bcdedit, 大部分就是跟bios,多重開機,secure boot,winPE,…etc有點關係, 因為 bcdedit就是去編輯BCD資料的指令! 所謂的開機設定資料 (BCD) 檔案, 就是提供一個存放區, 可用於說明開機應用程式和開機應用程式設定。所以說 BCDEdit 為命令列工具, 可用於管理 BCD 存放區。它可用於各種不同的目的,包括建立新的存放區、修改現有的存放區、新增開機功能表選項等。BCDEdit 本質上可提供與舊版 Windows 上之 Bootcfg.exe 相同的目的,但有兩項重大改進:
BCDEdit 顯示比 Bootcfg.exe 範圍還要廣泛的開機選項。


Windows 開機管理程式位於識別元 {bootmgr} 下的 device 與 path 設定,必須指向正確的磁碟分割與可執行檔。其他設定可以參考修改 BCD 存放區範本
在 Windows Vista 的 BCD 範本中,有如下的這些設定:

在 Windows Server 2008 的 BCD 範本中,有如下的這些設定:

兩種模式(Legacy 32bits / UEFI 64bits )的 bcd檔:

  • Legacy 32bits
    • C:\boot\bcd
  • UEFI 64bits
    • C:\elf\microsoft\boot\bcd
  • 或是兩種皆支援的hybrid mode

(出處:Repair Windows BCD – Windows 10/8.1/7/Vista)
In Windows Vista, Windows 7, Windows 8/8.1 and Windows 10 the System Boot Configuration Data (BCD) is stored in a file in folder “\Boot”.

The full path to this file is “[active partition]\Boot\BCD“.
(On UEFI/GPT the full path is “[EFI system partition]\EFI\Microsoft\Boot\BCD“)

Windows NT6 (Vista, Windows 7/8/10) BIOS/MBR boot process depends on the presence of an active partition on hard disk.
(On UEFI/GPT boot process depends on the presence of EFI System Partition(ESP) on hard disk)

BIOS/MBR boot process from hard disk goes like this:

  1. BIOS firmware initialization and self test (Power On Self Test – POST)
  2. load and execution of MBR (Master Boot Record) on first disk
  3. load and execution of partition boot record (PBR) on active partition
  4. load and execution of boot manager (“\bootmgr”) from active partition and then display of boot menu (skipped if only one boot entry)
  5. load and execution of Windows NT6 loader – file “winload.exe” from \Windows\System32 folder
  6. load and execution of kernel and drivers

The active partition (also a primary partition) can be mapped to a drive letter like c:, d: or be the unmapped “System Reserved” partition. You can use Disk Management or diskpart.exe to view and set the active partition.

If BCD resides on an unmapped active partition the full path is “\Device\HarddiskVolumeN\Boot\BCD” where N is a number starting from 1. If active partition is mapped to c: drive then the full path to system BCD is “c:\Boot\BCD”.

UEFI/GPT boot process from hard disk goes like this:

  1. UEFI firmware initialization
  2. load and execution of first boot candidate (first entry in NVRAM boot order – usually Windows firmware boot manager(\EFI\Microsoft\Boot\bootmgfw.efi))
    no master(MBR) and partition boot record(PBR) code used!
  3. display of Windows boot menu (skipped if only one boot entry)
    (it is not clear what’s the purpose of Windows boot manager (“\EFI\Microsoft\Boot\bootmgr.efi”) – should be investigated)
  4. load and execution of Windows NT6 loader – file “winload.efi” from “\Windows\System32” folder
  5. load and execution of kernel and drivers

And here a visualization of Windows UEFI boot process from an UEFI Plugfest – Windows boot environment by Murali Ravirala from Microsoft.

轉錄-Boot Process and BCDEdit

(出處)The new boot environment supports both BIOS and Unified Extended Firmware Interface (UEFI) firmware models. It uses a new data store for boot configuration data (the BCD store) that replaces Boot.ini and provides new boot applications that replace the previous Windows® loader (Ntldr.exe), including a new Windows boot manager and Windows boot loader.

What does the boot process do?
When a computer is turned on, it must perform a variety of tasks before it is ready to start running applications. To accomplish these tasks, the computer runs startup software that resides in the firmware. This software (a “boot loader”) locates and initializes the operating system kernel and prepares access to hardware devices before the operating system is ready to start running applications. The boot loader is typically independent of a specific operating system, but it can locate the code to start the next step, which is the operating system–specific phase of system startup. The boot loader and related boot configuration information is often stored in system files that are separate from the operating system, application programs, and user data.

Are there any special considerations?
You must have administrative rights to change the boot configuration for Windows. To change the boot configuration, start the boot configuration application BCDEdit.exe from a command prompt with administrative rights. Be aware that changing the boot configuration can make the system unable to start. To avoid problems with this, make a backup copy of the current boot configuration ahead of time by using the bcdedit /export save-bcd command.

Support for both BIOS and UEFI firmware
UEFI is the next generation of firmware architecture that is designed to replace the BIOS architecture. The new Windows boot environment is designed for both BIOS and UEFI and uses a common data store that can exchange boot configuration information between the firmware, the boot loader, and boot applications.

New boot applications
The functionality that was previously combined in Ntldr.exe is now separated into multiple applications:

  • Windows Boot Manager (Bootmgr.exe or Bootmgr.efi). This application is independent of the operating system and uses the firmware to load the Windows boot loader either from a particular disk partition or over a network connection (in the case of network boot).
  • Windows Boot Loader (Winload.exe or Winload.efi). This application is part of the operating system and loads a specific version of Windows. It uses the firmware to load the operating system kernel and to boot critical device drivers from a local hard disk.
  • Windows Resume (Winresume.exe or Winresume.efi). Windows Resume finds a hibernation image and then uses the firmware to read the hibernation file into RAM and to resume the operating system from the hibernation state.

The Windows boot environment also includes the Windows Memory Tester (Memdiag.exe or Memdiag.efi). You can start this diagnostic tool from the boot manager to verify that RAM is working correctly.

New data store that replaces Boot.ini
The Boot Configuration Data (BCD) store replaces the text-based Boot.ini file. In the BCD store, the Windows boot manager, the Windows boot loader, and other boot applications are represented as program objects (GUIDs) instead of text items. A new tool, BCDEdit.exe, enables you to use basic and extended commands to modify these objects in order to control all aspects of the boot process. Although the data store represents each object with a GUID, some objects have alias names for common use, such as {bootmgr} (which refers to boot manager) and {default} (which refers to the default Windows boot loader). Applications can modify boot configuration data by using a new BCD Windows Management Instrumentation (WMI) provider.

You can use the standard system application Msconfig.exe to provide a graphical interface for viewing and modifying a subset of the boot configuration settings. You must run Msconfig.exe with administrative rights.




  • 在NT60系列操作系統(Windows 7/Vista/2008)中的一個命令行工具,用於建立和重新配置bootloader,後者無須再使用boot.ini文件。
  • 也就是說,使用BCDEdit這個工具,能夠修改NT60 系列系統的啟動菜單在之前基於NT50系列(Windows XP/2000/2003)的Windows系統中,Windows使用Ntldr作為Boot Loader來啟動系統,但在新的NT60系列系統中,微軟引入瞭一種全新的boot loader架構,Windows Boot Manager (Bootmgr.exe)。
  • 與Ntldr嚴重地依賴於硬件不同的是,NT60中的新架構可以實現完整的硬件獨立性,且能夠與多種操作系統無縫結合,讓NT60的啟動/引導過程更加快速與安全。
  • 同時,將之前Windows 系統中由Boot.ini管理的內容移交給新的Boot Configuration Data (BCD : 啟動設置數據),當然,也提供瞭新的啟動選項編輯工具,BCDEdit (BCDEdit.exe),來管理啟動設置。
  • ——所謂boot loader,在指在內核運行之前執行的一段小程序,系統通過它來初始化硬件設備、建立內存空間的映射圖等,將系統的軟硬件環境設置成一個合適的狀態,為最終調用操作系統內核準備好正確的環境。
  • ——在啟動過程中,Ntldr 使用Boot.ini 文件來確定在啟動/引導過程中要顯示哪些操作系統選項,我們對啟動選項的設置可以通過修改boot.ini文件中相應內容實現。
  • Windows NT60 (Windows 7/Vista/2008)與早期NT52 系列系統(Windows XP/2000/2003)啟動的對比
    • 在傳統的基於BIOS的計算機中,如果只安裝NT60 系列操作系統(Windows 7/Vista/2008),您將會發現Boot.ini 文件已經徹底從系統中消失;如果系統中安裝瞭NT60 和之前的Windows 系統,如NT52 系列操作系統 (Windows XP/2000/2003),雖然仍可找到Boot.ini 文件,不過,這個文件只作用於那些系統,而不會對NT60 的啟動有任何影響。
    • 而在基於EFI (Extensible Firmware Interface : 可擴展固件接口,以後采用這種接口的PC會越來越多)的計算機中,Boot.ini 文件則更不復存在,在基於EFI的系統中,啟動選項被貯存在主板的存儲器中。此時要修改啟動選項,要麼通過能夠讀寫NVRAM的工具如NvrBoot,要麼使用上文提到的BCDEdit。
    • 由此可見,在NT60中,想要再像之前NT52 中那樣通過一個簡單的文本編輯器來修改Boot.ini(或用NT52自帶工具Bootcfg)的方式來管理啟動選項已經不可能瞭,要對啟動設置進行修改,只能使用命令格式相對要復雜得多的BCDEdit。
  • 此外,微軟也在NT60 中提供瞭可通過WMI (Windows Management Instrumentation : Windows管理規范)調用的BCD 類,通過它可以用編程的方式修改BCD數據。不過,相信對絕大多數根本不會接觸編程的用戶而言,這更是不可能的任務。

BCDEdit 使用前註意

  • 1.工具性質: command line tool
    • 需要註意的是,BCDEdit不是一個運行於圖形界面下的程序,而是一個命令行工具,該文件(Bcdedit.exe) 位於 “\Windows\System 32”目錄下。
  • 2.啟動
    • 要執行BCDEdit,首先應進入命令行窗口,並要將操作用戶並提升至管理員權限。另外,該工具依賴於參數,如果不帶參數,則不能正常使用。
    • 在命令行窗口中,轉到系統目錄如 “C:/windows/system32”下,然後輸入“bcdedit <參數>” 即可。也可直接在任意目錄運行,因為System32目錄本身在環境變量“Path”的范圍內。
  • 3.BCDEdit命令核心
    • (1)幫助
      • bcdedit /? : 顯示全部的命令幫助(都隻是概述)。
      • bcdedit.exe /? <命令> : 顯示指定命令參數的詳細信息(無需帶斜杠)。使用中對其他任何可用參數也均可使用本命令格式查看該參數的具體說明。
    • (2)Enum
      • 通過命令行工具Bcdedit,我們可以添加、刪除及修改BCD (Boot Configuration Data)中的對象。
      • 在BCD中,每個對象均具有唯一的GUID (Globally Unique Identifier : 全局唯一標識符),如系統中的每塊硬盤、每個分區的GUID (全局唯一標識符)均不相同。
      • 在BCD中,硬盤或分區的GUID可分為如下幾類:
        • {ntldr}: 指存在上代NT50系列操作系統(Windows XP/2000/2003)的硬盤或分區;
        • {default}: 默認所在硬盤或分區;
        • {current}: 當前硬盤或分區;
        • {}: 類似於這個格式的GUID指其他安裝瞭操作系統的硬盤或分區。
      • (註:相應的GUID可通過“bcdedit ”或“bcdedit /enum all ”命令查看。這樣會顯示BCD當前的啟動設置數據,包含瞭所有在BCD記錄中的操作系統,均能顯示其GUID,用戶可以此作更改啟動數據的參考。)
    • (3)保險措施(使用BCDEdit備份與恢復啟動選項)
      • 在對Windows NT60的啟動選項修改之前,最好先對其備份,以防萬一操作失誤或其他故障導致系統無法啟動。
        • bcdedit /export <目錄> : 將啟動設置備份到指定的目錄下;
        • bcdedit /import <目錄> : 恢復之前備份在指定目錄下啟動選項。
      • 註:當需要還原備份的啟動選項時,應仔細檢查備份的啟動選項是否對應於自己所需要的,否則重新設置會比較麻煩。


  • 作為一種良好的操作習慣,在對Windows Vista的啟動選項進行任何修改前,首先要對BCD中的啟動選項進行備份,相應的命令上頁我們已介紹過,在此不再贅述;其次,使用“bcdedit ”或“bcdedit /enum all ”來查看系統中硬盤或分區的正確GUID 標識,並將其記錄下來。
  • 畢竟,BCDEdit只是一款命令行工具,我們操作時需手動輸入類似“”這樣的長字符串時,很容易出錯,而這往往會導致Windows Vista啟動失敗。
  • 下面詳細介紹使用BCDEdit修改啟動選項的常用命令格式:
    • bcdedit /set {ntldr} Description “Windows XP Professional SP2”: 修改上一代在啟動菜單中的顯示內容,比如說我們也可將其修改為“Vista天地de專用XP SP2”之類。註意,命令中的引號不可省略;操作系統
    • bcdedit /set {current} description “Windows Vista Build 5270 x86″: 修改當前啟動硬盤或分區上的操作系統在啟動菜單中的顯示內容。註意,當前分區上的操作系統可能為Windows Vista,也可以是其他系統,當然,命令中的引號也不可省略;
    • bcdedit /set {} description “Windows Vista Build 5270 x64”: 修改安裝於其他硬盤或分區的系統在啟動菜單中的顯示內容,使用這項命令時一定要註意該硬盤/分區的GUID輸入正確,相應的GUID可通過“bcdedit ”或“bcdedit /enum all ”命令查看。
    • bcdedit /default {current} :將當前啟動硬盤/分區中的操作系統設置為默認啟動的系統;
    • bcdedit /default {} :設置指定GUID上的操作系統為默認啟動的系統;
    • bcdedit /default {ntldr} :設置上一代Windows 系統Windows XP為默認啟動的系統;
    • bcdedit /displayorder : 設置啟用菜單中各項的顯示順序,如:
    • bcdedit.exe /displayorder {ntldr} {current} :將首先顯示Windows XP,然後再顯示默認啟動的系統如Windows Vista;
    • bcdedit /timeout 15 :將默認的啟動菜單顯示時間30秒更改為15秒,當然,您可以將這個時間修改為任何您希望的數值。
    • 使用BCDEdit修復硬盤/分區結構錯誤

X:\>X:\boot\fixntfs.exe -lh -all : 這時的“X: ”指引導目錄 “boot” 所在的硬盤/分區;
bcdedit /set device partition=X: : 將指定GUID的分區設為啟動分區。註意,這裡的“X: ”的GUID須與指定值不同,同時,搜狗電腦網,運行該命令後,必須接著運行下面的osdevice命令;
bcdedit /set osdevice partition=X: : 將指定GUID的分區設為啟動分區。註意,這個命令必須與上面的device命令配對使用,同時“X: ”的GUID須與指定值不同。



Bcdedit 位於X:\Windows\system32\ “X:”為安裝Vista的盤符。

/createstore 創建一個新的空白啟動配置數據文件。
bcdedit /createstore C:\Data\BCD 創建BCD啟動配置數據文件儲存到“C:\DATA\”文件夾。
/export 備份啟動配置數據文件。
bcdedit /export “C:\Data\BCD Backup” 備份BCD啟動配置文件到“C:\Data\”文件夾,並以“BCD Backup”命名。
/import 還原啟動配置數據文件。
bcdedit /import “C:\Data\BCD Backup” 從“C:\Data\”文件夾恢復BCD啟動配置文件。

/copy 項目拷貝
bcdedit /copy /d “Copy of entry”
/create 新建項目
bcdedit /create /d “Earlier Windows OS Loader”
bcdedit /create /d “Ramdisk options”
bcdedit /create /d “Windows Vista” /application osloader
bcdedit /create /d “Debugger Settings”
/delete 刪除項目
bcdedit /delete
bcdedit /delete /cleanup
bcdedit /delete /nocleanup
bcdedit /delete /f

/deletevalue 刪除項目選擇項。
bcdedit /deletevalue bootsequence
bcdedit /deletevalue winpe
刪除來自指定的操作的Windows PE 數值系統開機項目:
bcdedit /deletevalue winpe
/set 設定項目選擇項數值。
bcdedit /set device partition=C:
指定的操作系統引導文件“windows\ system 32\ winload.exe”:
bcdedit /set path \windows\system32\winload.exe
bcdedit /set nx optin
默認XP系統名稱在Vista啟動管理器中是”earlier version of Windows”,更改:
bcdedit /set Description “Windows XP Professional SP2″
默認Vista系統名稱在Vista啟動管理器中是”Microsoft Windows”,更改:
bcdedit /set Description “Windows Vista 5456”
/enum 在儲存中的列表項目。
bcdedit /enum OSLOADER
bcdedit /enum BOOTMGR
bcdedit /enum
bcdedit /enum
/v 列出所有活動的項目
bcdedit /enum ACTIVE /v

/bootsequence 設定啟動列表順序。
bcdedit /bootsequence {cbd971bf-b7b8-4885-951a- fa03044f5d71}
bcdedit /bootsequence /addlast
/default 設定默認啟動項目。
bcdedit /default
bcdedit /default
/displayorder 設定哪一個系統啟動顯示多啟動畫面。
bcdedit /displayorder
bcdedit /displayorder /addlast
/timeout 設定啟動暫停數值。
/toolsdisplayorder 設定命令在哪一個啟動管理顯示工具畫面。
bcdedit /toolsdisplayorder
bcdedit /toolsdisplayorder /addlast

bcdedit /bootems ON
為目前的操作系統啟動項目EMS 開啟:
bcdedit /ems ON
/emssettings 設定緊急處理服務參數。
設定EMS 參數使用基本輸出入系統設定:
bcdedit /emssettings BIOS

實際上,大家打開命令提示符,輸入 bcdedit /? 同樣可以獲得更詳盡的幫助:

BCDEdit 命令列選項

BCDEdit.exe 有下列可用的命令列選項。
BCDEdit / Command [Argument1] [Argument2] …

  • /createstore
  • /export
  • /import
    利用先前使用 /export 選項所產生的備份資料檔案,還原系統存放區的狀態。這個命令會在進行匯入之前,先刪除任何存在於系統存放區中的項目。這個命令僅對系統存放區有效。
  • /store
    這個選項可用於大部分的 BCDedit 命令,以指定要使用的存放區。如果未指定這個選項,則 BCDEdit 會在系統存放區上操作。自行執行 bcdedit /store 命令,相當於執行 bcdedit /enum active 命令。
  • /copy
  • /create
    在開機設定資料存放區中建立新項目。如果指定了通用的識別元,則無法指定 /application、/inherit 及 /device 選項。如果未指定識別元或不是通用的識別元,則必須指定 /application、/inherit 或 /device 選項。
  • /delete
  • /deletevalue
  • /set
  • /enum
    列出存放區中的項目。/enum 選項是 BCEdit 的預設值,因此執行 bcdedit 命令時,若未加上選項,則相當於執行 bcdedit /enum active 命令。
  • /v
    詳細資料模式。通常任何通用的項目識別元都會以好記的簡短形式呈現。指定 /v 作為命令列選項,會將所有的識別元全部顯示出來。自行執行 bcdedit /v 命令,相當於執行 bcdedit /enum active /v 命令。
  • /bootsequence
    指定一次性顯示順序,以用於下一次開機。這個命令類似於 /displayorder 選項,唯一的不同在於它僅用於下一次電腦啟動時。之後,電腦會還原為原本的顯示順序。
  • /default
  • /displayorder
  • /timeout
    指定在開機管理程式選取預設項目之前,要等候的時間 (以秒為單位)。
  • /toolsdisplayorder
    指定顯示 [工具] 功能表時,開機管理程式要使用的顯示順序。
  • /bootems
    啟用或停用指定項目的緊急管理服務 (EMS)。
  • /ems
    啟用或停用指定之作業系統開機項目的 EMS。
  • /emssettings
    設定電腦的全域 EMS 設定。/emssettings 不會啟用或停用任何特定開機項目的 EMS。
  • /bootdebug
  • /dbgsettings
    指定或顯示系統的全域偵錯工具設定。這個命令不會啟用或停用核心偵錯工具,請針對該用途使用 /debug 選項。若要設定個別的全域偵錯工具設定,請使用 bcdedit /setdbgsettings type value 命令。
  • /debug

轉錄-Creating BCD from scratch with BCDedit.exe and add “Repair my computer” WinRE Recovery Environment

My Boot Configuration Data (BCD Store) for my Windows 7 got hosed and I had to delete it and boot off a Windows DVD, hit Shift + F10 to get at a command prompt, delete my old BCD and run Bootrec.exe /rebuildBCD to even be able to boot my system. But RebuildBCD left the file with the bare minimum necessary to boot, nearly blank, and I lost the option to run “Repair My Computer” from the F8 screen. I found a useful website: http://forum.acronis.com/forum/6758 that helped me get back on the right track, but I had to dabble around myself to get all the settings that Windows 7 Installation would normally handle. Follow these instructions to restore your BCD file so that you can run “Repair” off the hard drive instead of digging around for a DVD. “bcdedit /enum all” lists your BCD config and “bcdedit /enum all /v” lists all GUIDs instead of friendlynames. the GUID’s I have listed ARE different (make sure you check the 8th digit). Before you begin you might want to do “bcdedit /export C:\before.BCD”.

1. Create necessary optional entries
bcdedit /create {globalsettings}
bcdedit /create {bootloadersettings}
bcdedit /create {resumeloadersettings}
bcdedit /create {emssettings}
bcdedit /create {dbgsettings}
bcdedit /create {hypervisorsettings}
bcdedit /create {badmemory}
bcdedit /create {memdiag}

2. Establish proper settings for these optional entries
bcdedit /set {bootmgr} INHERIT {globalsettings}
bcdedit /set {current} INHERIT {bootloadersettings}
bcdedit /set {globalsettings} INHERIT {dbgsettings} {emssettings} {badmemory}
bcdedit /set {bootloadersettings} INHERIT {globalsettings} {hypervisorsettings}
bcdedit /set {resumeloadersettings} INHERIT {globalsettings}
bcdedit /set {emssettings} bootems YES
bcdedit /dbgsettings SERIAL DEBUGPORT:1 BAUDRATE:115200
bcdedit /hypervisorsettings SERIAL DEBUGPORT:1 BAUDRATE:115200
bcdedit /toolsdisplayorder {memdiag}

bcdedit /set {memdiag} description “Windows Memory Diagnostic”
bcdedit /set {memdiag} device partition=\Device\HarddiskVolume1
bcdedit /set {memdiag} path \boot\memtest.exe
bcdedit /set {memdiag} locale en-US
bcdedit /set {memdiag} inherit {globalsettings}
bcdedit /set {memdiag} badmemoryaccess Yes

3. Link “Windows Boot Manager” and primary “Windows Boot Loader” to your existing “Resume from Hibernate” identifier (replace the GUID)
bcdedit /set {bootmgr} resumeobject {8de128fe-03a5-11e1-a7d3-a215a48a5459}
bcdedit /set {current} resumeobject {8de128fe-03a5-11e1-a7d3-a215a48a5459}

4. Create loader entry for the “Recovery”(Repair My Computer)
Check C:\Recovery\ (gain access by adding “Users” READ permission)
Copy & Use that GUID here for device and osdevice – in my case 8de128ff-………… omitting the curly braces { } after [C:]\Recovery
On Line 2 and Line 3, for device and OSdevice, the final GUID after \Winre.wim doesnt exist yet (if you look carefully the 8th digit is changed – and will now have to be created ….
after \Winre.wim, create a NEW UNUSED GUID (change the 8th digit) – it will be used in step 6.

bcdedit /create {8de128ff-03a5-11e1-a7d3-a215a48a5459} /application osloader
bcdedit /set {8de128ff-03a5-11e1-a7d3-a215a48a5459} device ramdisk=[C:]\Recovery\8de128ff-03a5-11e1-a7d3-a215a48a5459\Winre.wim,{8de128f5-03a5-11e1-a7d3-a215a48a5459}
bcdedit /set {8de128ff-03a5-11e1-a7d3-a215a48a5459} osdevice ramdisk=[C:]\Recovery\8de128ff-03a5-11e1-a7d3-a215a48a5459\Winre.wim,{8de128f5-03a5-11e1-a7d3-a215a48a5459}
bcdedit /set {8de128ff-03a5-11e1-a7d3-a215a48a5459} path \windows\system32\winload.exe
bcdedit /set {8de128ff-03a5-11e1-a7d3-a215a48a5459} description “Windows Recovery Environment WinRE”
bcdedit /set {8de128ff-03a5-11e1-a7d3-a215a48a5459} inherit {bootloadersettings}
bcdedit /set {8de128ff-03a5-11e1-a7d3-a215a48a5459} systemroot \windows
bcdedit /set {8de128ff-03a5-11e1-a7d3-a215a48a5459} nx OptIn
bcdedit /set {8de128ff-03a5-11e1-a7d3-a215a48a5459} winpe yes

5. Enable the {current} OS to allow the Recovery Sequence you just created
bcdedit /set {current} recoverysequence {8de128ff-03a5-11e1-a7d3-a215a48a5459}
bcdedit /set {current} recoveryenabled Yes

6. With that NEW UNUSED GUID you just created in step 4, create the “Ramdisk Options” entry for the Recovery Sequence
On Line 4, after \Recovery\ – use the GUID you found in C:\Recovery\ -again Omit the Curly braces { }
bcdedit /create {8de128f5-03a5-11e1-a7d3-a215a48a5459} /device
bcdedit /set {8de128f5-03a5-11e1-a7d3-a215a48a5459} description “Ramdisk Options”
bcdedit /set {8de128f5-03a5-11e1-a7d3-a215a48a5459} ramdisksdidevice partition=C:
bcdedit /set {8de128f5-03a5-11e1-a7d3-a215a48a5459} ramdisksdipath \Recovery\8de128ff-03a5-11e1-a7d3-a215a48a5459\boot.sdi

Now you are done, and might want to export again to not lose your work, “bcdedit /export C:\AFTER.BCD”


bcdedit /enum all 列出存放區中的所有項目
bcdedit /store S:\EFI\Microsoft\Boot\BCD /enum all 列出(S:\EFI\Microsoft\Boot\BCD)存放區中的所有項目


修改 BCD 存放區範本
Walkthrough: Boot Windows PE from a UEFI-based Hard Disk