Walkthrough: Install Windows PE to CD, USB Flash Drive, or USB Hard Drive
Published: February 29, 2012
Updated: May 31, 2012
Applies To: Windows 8, Windows Server 2008 R2, Windows Server 2012
Use Windows® Preinstallation Environment (Windows PE) to boot a computer that has no operating system so that you can install Windows. We recommend that you install Windows PE onto removable media, such as a CD or DVD, USB flash drive, or USB hard drive. Because Windows PE boots into memory, you can remove the media after the computer boots.
In this topic:
-
Step 1: Set Up a Windows PE Build Environment
-
Step 2: Optimize a Custom Image (Optional)
-
Step 3: Create Windows PE Media to Boot from RAM Disk
To complete this walkthrough, you need the following:
-
A technician computer that has Windows 8 and the Windows® Assessment and Deployment Kit (Windows ADK) installed.
-
For testing, a destination computer that has Windows 8 installed.
-
Removable storage media: a CD or DVD, USB flash drive, or external USB hard drive. The size of the removable media must be at least 64 megabytes (MB) larger than the Windows PE image, plus the size of any additional files or applications that you add.
In addition, be aware of the following precautions before you start this walkthrough:
-
An x64-based Unified Extensible Firmware Interface (UEFI) computer can boot only by using x64 Windows PE boot files. This differs from BIOS. In BIOS, an x64-based computer can boot by using x86 Windows PE boot files.
-
On some UEFI computers, you cannot install Windows in BIOS-compatibility mode, and you might have to switch to UEFI-compatibility mode. For more information, see UEFI Firmware.
-
When you boot from RAM disk, Windows PE boots directly into memory and is assigned the drive letter X. This drive letter does not correspond to the media that you booted the computer from. Whenever you reboot, use
Diskpart List volumeto identify drive letters. -
The FAT32 file system format has a 4-gigabyte (GB) file size limit and a 32-GB partition size limit.
In this step, you set up a Windows PE build environment.
-
On your technician computer: Click Start , and type deployment . Right-click Deployment and Imaging Tools Environment and then select Run as administrator .
A Deployment Tools and Imaging Environment Command Prompt window opens with environment variables automatically set to point to all the necessary tools. By default, all tools are installed in the C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools (64-bit Windows installation) or C:\Program Files\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools (32-bit Windows installation) folder.
-
At the command prompt, enter the following Copype command with the architecture and the working directory for the Windows PE files.
Copype amd64 C:\winpe_amd64
The following directory structure is created.
<workingDirectory> <workingDirectory> \media <workingDirectory> \mount
Note When Copype copies the Windows PE base image (Winpe.wim) to the <workingDirectory> \media\sources folder, it renames the base image from Winpe.wim to Boot.wim.
You can create bootable media by using the default Windows PE image (Winpe.wim). Optionally, you can customize the default Windows PE image before you create bootable media.
In this step, you optimize a custom image to reduce its size by using profiling.
-
To create a custom image, see Walkthrough: Create a Custom Windows PE Image.
-
To add a custom application or script to your image, see How to Add an Application to Windows PE.
-
To reduce the size of your custom image, see Walkthrough: Create an Optimized Windows PE Image with Profiling.
In this step, you can make the following removable media bootable from RAM disk: CD or DVD, USB flash drive, or external USB hard drive.
If you have to change the Multilanguage User Interface (MUI) to match your locale, you must do so before you create the .iso file and burn the image. When you change the MUI, UI elements such as prompts and error messages are localized.
-
On your technician computer, insert a CD or DVD.
-
Optional: Change the MUI to your locale:
-
Copy the MUI files for your locale to the C:\winpe_amd64\media\ folder, where the Windows PE files are located.
-
Use the BCDedit tool to set bootmgr in the Boot Configuration Data (BCD) file to your locale:
-
For UEFI, use the following syntax, where
<amd64>
is the architecture of the Windows PE boot files for a UEFI computer and
<fr-fr>
is the French-France locale ID (LCID).
Bcdedit /store C:\winpe_ <amd64> \media\EFI\Microsoft\Boot\BCD /set {bootmgr} locale <fr-fr> -
For BIOS, use the following syntax, where
<x86>
is the architecture of the Windows PE boot files for an x86 BIOS computer and
<fr-fr>
is the French-France LCID.
Bcdedit /store C:\winpe_ <x86> \media\sources\boot\BCD /set {bootmgr} locale <fr-fr>
-
For UEFI, use the following syntax, where
<amd64>
is the architecture of the Windows PE boot files for a UEFI computer and
<fr-fr>
is the French-France locale ID (LCID).
-
-
Create an .iso file using the MakeWinPEMedia tool, for example:
Makewinpemedia /iso C:\winpe_amd64 C:\winpe_amd64\winpe_amd64.iso
-
Burn the image file onto a CD or DVD.
-
Start the destination computer, change the boot order if you need to, and test the bootable CD or DVD that you have created.
-
On your technician computer, insert a USB flash drive.
-
Copy the Windows PE files to the USB flash drive by using the MakeWinPEMedia tool, for example:
Makewinpemedia /ufd C:\winpe_amd64 F:
where F:\ is the drive letter of the USB flash drive.
-
Start the destination computer, change the boot order if you need to, and test the bootable USB flash drive that you have created.
The following commands prepare a USB hard drive that can boot on either a BIOS-based or UEFI-based PC.
On UEFI-based PCs, Windows PE requires a boot partition formatted using the FAT32 file format, which only supports file sizes up to 4GB. We recommend creating a separate partition on the drive formatted using NTFS so that you can store Windows images and other large files.
When Windows PE boots, it runs in memory, so you can disconnect the external hard drive at any time and continue using Windows PE. For faster boot times, consider installing Windows PE so it runs from the drive instead. For instructions, see Walkthrough: Flat-Boot Windows PE.
-
On your technician computer, attach an external hard drive.
-
At an elevated command prompt, use the Diskpart tool to format the external hard drive, as shown in the following example. Windows PE requires an active partition that has a size equal to or larger than the size of the Windows PE image.
Diskpart list disk select <disk number> clean rem === 1. Create the system partition === create partition primary size=1500 active format quick fs=fat32 label="Windows PE" assign letter=P rem === 2. Create a data partition (optional). === rem This partition fills the rest of the disk. create partition primary format quick fs=ntfs label="Other Files" assign letter=O list vol exit -
Copy the Windows PE files to the hard drive by using the MakeWinPEMedia tool, for example:
Makewinpemedia /ufd C:\winpe_amd64 P:
where P: is the drive letter of the Windows PE partition on the external hard drive.
-
Start the destination computer, change the boot order if necessary, and test the bootable external hard drive that you have created.
Tasks
Walkthrough: Add Multilingual Support to Windows SetupReference
Copype Command-Line OptionsMakewinpemedia Command-Line Options
Oscdimg Command-Line Options
Windows PE Servicing Command-Line Options
Concepts
Booting Windows PE from RAM DiskBCDboot Command-Line Options
Other Resources
Hard Drives and Partitions
