Partager via


Deploy Push-Button Reset Features

Applies To: Windows 8, Windows 8.1

This walkthrough shows how to create and deploy a customized push-button reset recovery image.

In this topic:

  • Step 1: Prepare to Deploy PCs by Creating Scripts

  • Step 2: Deploy Recovery Tools

Prerequisites

To complete this walkthrough, you need the following:

Step 1: Prepare to Deploy PCs by Creating Scripts

This step describes the process you complete one time in preparation of deploying recovery images.

Create a script to add drive letters to each partition

  1. In Notepad, create a text file with the commands required to add drive letters to each partition.

    • UEFI:

      rem == AssignLettersToPartitions-UEFI.txt
      select disk 0
      select partition 1
      assign letter="T"
      select partition 2
      assign letter="S"
      select partition 4
      assign letter="W"
      select partition 5
      assign letter="R"
      list volume
      exit
      
    • BIOS:

      rem == AssignLettersToPartitions-BIOS.txt
      select disk 0
      select partition 1
      assign letter="S"
      select partition 2
      assign letter="W"
      select partition 3
      assign letter="R"
      list volume
      exit
      
  2. Save your completed file as either E:\Recovery\AssignLettersToPartitions-UEFI.txt or E:\Recovery\AssignLettersToPartitions-BIOS.txt, based on your firmware type.

Create a script to identify the recovery partitions and to hide drive letters

  1. In Notepad, create a text file with the commands required to identify and hide the recovery partitions.

    • UEFI:

      rem == HideRecoveryPartitions-UEFI.txt
      select disk 0 
      select partition 1 
      remove 
      set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac 
      gpt attributes=0x8000000000000001 
      select partition 5 
      remove 
      set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac 
      gpt attributes=0x8000000000000001 
      list volume
      

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

      The recovery partitions use the GPT attributes: 0x8000000000000001 to define the partitions with a combination of two attributes: GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER and GPT_ATTRIBUTE_PLATFORM_REQUIRED. For more information, see PARTITION_INFORMATION_GPT structure.

    • BIOS

      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.

Step 2: Deploy Recovery Tools

This step describes the process you complete when deploying recovery images onto each PC you manufacture.

To enable completion of the first-boot sequence

  1. Boot the destination computer.

  2. When Out-Of-Box Experience (OOBE) appears, turn off the computer by holding down the power button for more than five seconds.

  3. Boot into Windows PE.

To capture the recovery partition

  1. Add the drive letters to your recovery partitions by using the script you created in Step 1: Prepare to Deploy PCs by Creating Scripts:

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

    Where <firmware> is either UEFI or BIOS.

  2. Capture the recovery image:

    Dism /Capture-Image /CaptureDir:W:\ /ImageFile:R:\RecoveryImage\Install.wim /Name:"Recovery image" /NoRpFix
    
  3. Restrict the Write and Modify permissions of the recovery image folder to the local Administrator group.

    W:\Windows\System32\icacls e:\recoveryImage /inheritance:r /T
    W:\Windows\System32\icacls e:\recoveryImage /grant:r SYSTEM:(F) /T
    W:\Windows\System32\icacls e:\recoveryImage /grant:r *S-1-5-32-544:(F) /T
    
  4. Optional: copy the push-button reset extensibility scripts and configuration files to the recovery image partition:

    Xcopy E:\RecoveryImage\* /s R:\RecoveryImage\
    

    For more information, see Add a Script to Push-Button Reset Features.

  5. Register the push-button reset recovery image:

    W:\Windows\System32\Reagentc /Setosimage /Path R:\RecoveryImage /Target W:\Windows /Index 1
    

To identify and hide the drive letters

  1. Identify and hide the recovery partitions by using the script you created in Step 1: Prepare to Deploy PCs by Creating Scripts:

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

    Where <firmware> is either UEFI or BIOS.

To check the status and location of the images before deployment

  1. Verify the status and location of the Windows RE boot image and the recovery image for push-button reset, based on your firmware type.

    W:\Windows\System32\Reagentc /info /target W:\Windows
    

    The configuration status text should resemble the following:

    • UEFI:

      Windows RE status: <either Enabled or Disabled>
      Windows RE location: 
      Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000
      Custom boot key scan code: 0x0
      Recovery image location: \\?\GLOBALROOT\device\harddisk0\partition5\RecoveryImage
      Recovery image index: 1
      Custom image location:
      Custom image index: 0
      
    • BIOS:

      Windows RE status: <either Enabled or Disabled>
      Windows RE location: 
      Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000
      Custom boot key scan code: 0x0
      Recovery image location: \\?\GLOBALROOT\device\harddisk0\partition3\recoveryImage
      Recovery image index: 1
      Custom image location: 
      Custom image index: 0
      

Note

The Windows RE status appears as <Disabled> before the specialize configuration pass runs, and <Enabled> after the specialize configuration pass runs.

  1. Shut down or reboot your computer, either by physically powering the computer off, or by using the following command:

    Wpeutil shutdown
    

Verify the push-button reset process

  1. Boot the computer, and then complete OOBE as if you were your user.

Important

Boot the system to Windows PE, and then copy the boot files to the system partition by running following command:

Where C: is the drive letter of your primary partition. If you need to determine your primary partition while in Windows PE, list the drive letters with the following Diskpart command: list vol.

Reboot the PC.

  1. Open the Settings charm > More PC settings, and then select General.

  2. Under Refresh your PC without affecting your files, click Get started, and then follow the instructions.

  3. Log on to the refreshed PC.

  4. If you're using custom scripts, verify that they worked correctly. For more information, see Add a Script to Push-Button Reset Features

  5. Open the Settings charm > More PC settings, and then select General.

  6. Under Reset your PC and start over, click Get started, and then follow the instructions.

  7. Follow the prompts to verify that you're not prompted to insert either the installation or recovery media.

  8. Complete OOBE as your user.

  9. Again, if you're using custom scripts, you must verify that they worked correctly. For more information, see Add a Script to Push-Button Reset Features

Next Steps

Now that you have customized and deployed the recovery image for push-button reset, you can optionally create recovery media to include with the PC. For more information, see Create Media to Run Push-Button Reset Features.

See Also

Tasks

Shrink the Push-Button Reset Image
Capture Images of Hard Disk Partitions Using DISM
Deploy Windows RE
Add a Script to Push-Button Reset Features
Create Media to Run Push-Button Reset Features

Reference

REAgentC Command-Line Options
DISM Image Management Command-Line Options

Concepts

Push-Button Reset Overview