次の方法で共有


Add a Hardware Recovery Button to Start Windows RE

Applies To: Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2

On UEFI-based computers, you can also configure a hardware recovery button (or button combination) to start Windows RE. This can help users get to the Windows RE menus more easily, and can help users recover their PCs in events where some early boot components, such as the boot configuration data or bootmgfw.efi, are corrupted.

To do this, you create a secondary boot path on the EFI system partition (ESP), including a secondary BCD store and bootmgfw.efi file.

Design guidance

  • The hardware recovery button (or button combination) should be usable even when the PC is powered off. When triggered, the PC should power on and go through the secondary boot path. This eliminates the need for users to press the button within a very short time window during and after POST.

  • For PCs that support firmware options menu, the secondary boot path should first display a simple menu which gives users the options to either boot Windows RE or to enter the firmware options menu. In the event that a misconfigured firmware setting prevents Windows RE from booting, this enables users to undo changes they might have made. For instructions on configuring the firmware options menu, contact your firmware manufacturer.

Prerequisites

Configure a Secondary Boot Path

  1. On the destination computer, boot to Windows PE.

  2. Assign drive letters to the system partition and the Windows RE tools partition.

    diskpart
    select disk 0
    select partition 1
    assign letter="T"
    select partition 2
    assign letter="S"
    exit
    
  3. Create a folder on the system partition to hold boot files for the secondary boot path.

    mkdir S:\EFI\Fabrikam
    
  4. Copy a set of boot files from the \EFI\Microsoft folder to the new folder.

    xcopy /e /h S:\EFI\Microsoft\* S:\EFI\Fabrikam\
    
  5. Delete the BCD store that was copied to the new folder in the previous step.

    del /a S:\EFI\Fabrikam\Boot\BCD
    
  6. Create a new BCD store and configure the required entries for booting Windows RE.

    bcdedit /createstore S:\BCD
    
    bcdedit /store S:\BCD /create {bootmgr} /d "Windows Boot Manager"
    bcdedit /store S:\BCD /set {bootmgr} device partition=S:
    bcdedit /store S:\BCD /set {bootmgr} locale en-US
    bcdedit /store S:\BCD /set {bootmgr} integrityservices Enable
    
    bcdedit /store S:\BCD /create {11111111-1111-1111-1111-111111111111} /d "Windows Recovery" /device
    bcdedit /store S:\BCD /set {11111111-1111-1111-1111-111111111111} ramdisksdidevice partition=T:
    bcdedit /store S:\BCD /set {11111111-1111-1111-1111-111111111111} ramdisksdipath \Recovery\WindowsRE\boot.sdi
    
    bcdedit /store S:\BCD /create {22222222-2222-2222-2222-222222222222} /d "Windows Recovery Environment" /application osloader
    bcdedit /store S:\BCD /set {bootmgr} default {22222222-2222-2222-2222-222222222222}
    bcdedit /store S:\BCD /set {bootmgr} displayorder {22222222-2222-2222-2222-222222222222}
    
    bcdedit /store S:\BCD /set {default} device ramdisk=[T:]\Recovery\WindowsRE\winre.wim,{11111111-1111-1111-1111-111111111111}
    bcdedit /store S:\BCD /set {default} path \Windows\System32\winload.efi
    bcdedit /store S:\BCD /set {default} locale en-US
    bcdedit /store S:\BCD /set {default} displaymessage "Recovery"
    bcdedit /store S:\BCD /set {default} osdevice ramdisk=[T:]\Recovery\WindowsRE\winre.wim,{11111111-1111-1111-1111-111111111111}
    bcdedit /store S:\BCD /set {default} systemroot \Windows
    bcdedit /store S:\BCD /set {default} nx OptIn
    bcdedit /store S:\BCD /set {default} bootmenupolicy Standard
    bcdedit /store S:\BCD /set {default} winpe Yes
    
  7. Move the newly-created BCD store to the secondary boot path.

    xcopy /h S:\BCD* S:\EFI\Fabrikam\Boot\.
    del /a S:\BCD*
    
  8. Create new a boot device entry at the end of the firmware boot order list. The entry should point to: S:\EFI\Fabrikam\Boot\bootmgfw.efi.

  9. Configure the firmware to use the newly-created boot device entry when the hardware button is pressed.

  10. Use Diskpart to conceal the ESP and Windows RE tools partition.

    select disk 0
    select partition 1
    remove
    set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
    gpt attributes=0x8000000000000001
    select partition 2
    remove
    gpt attributes=0x8000000000000001
    exit
    

Note

The hardware button will not be able to boot to Windows RE until the system has reached the Out-of-box Experience (OOBE).

See Also

Tasks

Deploy Windows RE