Partilhar via


Apply Windows images

In this section of the OEM Windows Deployment and Imaging Walkthrough, you use deployment scripts to apply a newly-captured image onto a test PC. These scripts set up the hard drive partitions and add the files from the Windows image to the partitions.

These scripts also configure the push-button reset recovery image for Windows client editions. Note that push-button reset features are not available in Windows Server editions.

There's different versions of these scripts for different PC firmware types (the newer UEFI-based BIOS, or the legacy BIOS). Some UEFI-based PCs include support for the older legacy BIOS. For more info, see UEFI Firmware.

Copy the sample scripts to the external USB hard drive

  1. Copy the sample scripts from either Windows Deployment sample scripts, or download them from the OEM Partner Center, to your external USB hard drive.

Format and set up the hard drive partitions on the reference PC

  1. Connect the external hard drive to the reference PC.

  2. At the Windows PE command line, format the primary hard drive, and create the partitions:

    diskpart /s E:\Deployment\CreatePartitions-<firmware>.txt
    

    where E is the drive letter of the external USB hard drive and <firmware> is UEFI or BIOS.

    The scripts create and configure the partitions.

  3. Verify that the script worked. At the end of the output of the script, verify that the following drive letters are included:

    • UEFI: T = WinRE Tools; S = System; C = Windows; R = Recovery image. (Note: the MSR partition is not shown.)

    • BIOS: S = System; C = Windows; R = Recovery image.

Note

Some partitions might not have a drive letter.
If you’re deploying to PCs with unformatted hard drives, change the Windows drive letter to a letter that’s near the end of the alphabet, such as W, to avoid drive letter conflicts. Do not use X, because this drive letter is reserved for Windows PE. After the PC reboots, the Windows partition is assigned the letter C, and the other partitions don’t receive drive letters.

Apply the Windows image to the newly-created partitions

  1. At the Windows PE command prompt, apply the image:

    E:\Deployment\ApplyImage-<firmware> E:\Images\ThinImage.wim
    

    where E is the drive letter of the external USB hard drive and <firmware> is UEFI or BIOS.

    This step can take several minutes.

Copy push-button reset configuration files to the PC

  1. At the Windows PE command prompt, copy the push-button reset configuration files to the recovery image partition:

    xcopy E:\Deployment\RecoveryImage-<firmware>\* /s R:\RecoveryImage\
    

    where E is the drive letter of the external USB hard drive and <firmware> is UEFI or BIOS.

Hide the recovery partitions

  1. Use the DiskPart command to hide the recovery partitions:

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

    where E is the drive letter of the external USB hard drive and <firmware> is UEFI or BIOS.

Reset the PC

  1. Disconnect the USB flash drive and the external USB hard drive and type exit.

    The PC restarts. This step can take a few minutes.

Warning

Troubleshooting: If the PC does not boot, try the following steps:

  1. Turn on the PC, and press the key that opens the boot-device selection menu for the PC (for example, the Esc key).

  2. UEFI: If there is a command for selecting a boot file, such as Boot from file, select this command. Then, browse to the boot file by using the menus. For example, the boot file might be in the following location: HardDrive01\EFI\BOOT\BOOTX64.EFI.

Verify that push-button reset works as intended

  1. Complete OOBE as a user.

  2. Refresh the PC:

    • Windows 8.1: Settings > Change PC Settings > Update & recovery > Recovery > Refresh your PC without affecting your files: Get started > Just remove my files.

    • Windows 8: Settings > Change PC settings > General > Refresh your PC without affecting your files: Get started > Just remove my files.

  3. Follow the prompts and verify that you are not prompted to insert installation or recovery media.

    This process takes several minutes.

  4. Verify that the user account exists, and you are not prompted to complete OOBE again.

  5. Reset the PC:

    • Windows 8.1: Settings > Change PC Settings > Update & recovery > Recovery > Remove everything and reinstall Windows: Get started.

    • Windows 8: Settings > Change PC settings > General > Remove everything and reinstall Windows: Get started.

  6. Follow the prompts and verify that you are not prompted to insert installation or recovery media.

    This process takes several minutes.

  7. Verify that the PC starts in OOBE and does not include any user account information.

  8. Troubleshooting: If you are prompted to insert installation or recovery media, follow these steps:

    1. Check to see if the Windows RE image is in the WinRE Tools partition (UEFI) or System partition (BIOS). If the image is not in the correct partition, copy an image from another PC into this partition, and then register its location again.

      UEFI:

      E:\Deployment\AssignLettersToPartitions-UEFI.txt
      
      copy E:\Images\WinRE-ModelSpecific.wim T:\Recovery\WindowsRE
      
      C:\Windows\System32\Reagentc /Setreimage /Path T:\Recovery\WindowsRE /Target C:\Windows
      

      BIOS:

      E:\Deployment\AssignLettersToPartitions-BIOS.txt
      
      copy E:\Images\WinRE-ModelSpecific.wim S:\Recovery\WindowsRE
      
      C:\Windows\System32\Reagentc /Setreimage /Path S:\Recovery\WindowsRE /Target C:\Windows
      
    2. Reapply the Windows image file and repeat the steps in this section.

See Also

Concepts

OEM Windows Deployment and Imaging Walkthrough