Deploy Windows RE

Use these steps to deploy Windows Recovery Environment (Windows RE) to a new computer, to help end users repair a PC when a system failure occurs.

Prerequisites

To complete this walkthrough, you need the following:

Step 1: Deploy Windows RE

  1. Create a new directory in the Windows RE Tools partition, and then copy your custom Windows RE tools image (Winre.wim) to this directory. The following are examples based on your firmware type:

    UEFI:

    mkdir T:\Recovery\WindowsRE
    
    xcopy /h W:\Windows\System32\Recovery\Winre.wim T:\Recovery\WindowsRE
    

    Where T: is the drive letter of your Windows RE Tools partition. For example:

    BIOS:

    mkdir S:\Recovery\WindowsRE
    
    xcopy /h W:\Windows\System32\Recovery\Winre.wim S:\Recovery\WindowsRE
    

    Where S: is the system partition.

  2. Register your custom Windows RE tools image:

    UEFI:

    C:\Windows\System32\Reagentc /setreimage /path T:\Recovery\WindowsRE /target W:\Windows
    

    Where T: is the Windows RE Tools partition.

    BIOS

    C:\Windows\System32\Reagentc /setreimage /path S:\Recovery\WindowsRE /target W:\Windows
    

    Where S: is the System partition.

  3. Optional: If you have added a custom tool to your Windows RE boot image, register it so that it will appear on the Advanced startup menu:

    Reagentc /setbootshelllink /configfile E:\Recovery\BootMenu\AddDiagnosticsToolToBootMenu.xml
    

    For more information about adding a custom tool, see Add a Custom Tool to the Windows RE Advanced startup Menu.

  4. Optional: Configure a hardware recovery button (or button combination) to run a secondary boot path that contains Windows RE. For more information, see Add a Hardware Recovery Button to Start Windows RE.

Step 2: Identify the Recovery Partitions and Hide the Drive Letters

Configure your partitions as recovery partitions, and then conceal the drive letters so the partitions don't appear in common Windows menus, such as File Explorer.

Prepare a DiskPart script to identify the recovery partitions and to hide drive letters

  1. In Notepad, create a text file that includes commands to identify and hide the recovery partitions. The following examples are based on your firmware type:

    UEFI:

    Use the ID: PARTITION_MSFT_RECOVERY_GUID (de94bba4-06d1-4d40-a16a-bfd50179d6ac) to define the partitions as recovery partitions.

    Use the GPT attributes: 0x8000000000000001 to hide the drive letters and to mark them as required, by using a combination of two attributes: GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER and GPT_ATTRIBUTE_PLATFORM_REQUIRED.

    For more information about UEFI hard drive partition attributes, see PARTITION_INFORMATION_GPT structure.

    rem == HideRecoveryPartitions-UEFI.txt
    select disk 0
    select partition 1
    remove
    set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
    gpt attributes=0x8000000000000001
    rem == If Push-button reset features are included, add the following commands:
    rem    select partition 5
    rem    remove
    rem    set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
    rem    gpt attributes=0x8000000000000001
    list volume
    

    BIOS:

    Use the attribute: id=27 to define the system partition, and use the remove command to remove the drive letter.

    rem == HideRecoveryPartitions-BIOS.txt
    select disk 0
    select partition 3
    set id=27
    remove
    list volume
    exit
    
  2. Save your completed file as either E:\Recovery\HideRecoveryPartitions-UEFI.txt or E:\Recovery\HideRecoveryPartitions-BIOS.txt, based on your firmware type.

Identify and hide the drive letters

  • Run the diskpart script to identify and hide the recovery partitions:

    Diskpart /s E:\Recovery\HideRecoveryPartitions-<firmware>.txt
    

    Where <firmware> is either UEFI or BIOS.

Verify that the Windows RE configuration is set correctly

  • Open an administrative command prompt.

    Verify the Windows RE information:

    reagentc /info
    

    Verify the following:

    • Windows RE status is enabled.
    • Windows RE location is on the correct partition.
    • The BCD GUID entry for WinRE is the same as the WinRE GUID entry in the file: reagent.xml. On BIOS-based PCs, this file is on the system partition, at \Recovery\<GUID>\. On UEFI-based PCs, this file is on the Windows RE Tools partition, at \Recovery\WindowsRE\.
    • WinRE is located in the \Recovery\WindowsRE directory

Windows Recovery Environment (Windows RE) Technical Reference

DISM Image Management Command-Line Options

Customize Windows RE

Add a Custom Tool to the Windows RE Advanced startup Menu