共用方式為


Walkthrough: Create a Bootable Windows PE RAM Disk on a USB Flash Disk

Applies To: Windows 7, Windows Server 2008 R2

Note

This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.

This walkthrough describes how you can create a bootable Windows® PE RAM disk on a USB flash drive (UFD). Windows PE RAM enables you to start a computer for the purposes of deployment or recovery. Windows PE RAM boots directly into memory, enabling you to remove the Windows PE media after boot.

Important

To create a bootable UEFI-based UBS flash drive, follow the instructions in Walkthrough: Boot Windows PE from a UEFI-based Hard Disk. To create a bootable UEFI-based UBS flash drive with these instructions, either prepare a UBS flash drive in place of a hard drive, or create a hard drive and then copy the contents of the hard drive onto a USB flash drive. To create bootable UEFI-based optical media, see Walkthrough: Create a Bootable Windows PE RAM Disk on CD-ROM.

Prerequisites

To complete this walkthrough, you need the following:

  • A technician computer, which provides all of the tools and the source files. For more information, see Building a Technician Computer.

  • Access to a computer running Windows® 7 or a Windows PE session.

  • A UFD. The size of the UFD must be at least 64 megabytes (MB) larger than your Windows PE image, plus the size of any additional files that you include.

Step 1: Set up a Windows PE build environment

In this step, you create a required directory structure that supports building a Windows PE image.

  1. On your technician computer, click Start, point to All Programs, point to Windows OPK or Windows AIK, right-click Deployment Tools Command Prompt, and then select Run as administrator.

    The menu shortcut opens a command-prompt window and automatically sets environment variables to point to all of the necessary tools. By default, all tools are installed at C:\Program Files\<kit>\Tools, where <kit> can be Windows OPK or Windows AIK.

  2. At the command prompt, run the Copype.cmd script. The script requires two arguments: hardware architecture and destination location.

    copype.cmd <arch> <destination>
    

    where <arch> can be x86, amd64, or ia64 and <destination> is a path to local directory. For example,

    copype.cmd x86 c:\winpe_x86
    

    Running the script creates the following directory structure and copies all of the necessary files for that architecture. For example,

    \Winpe_x86

    \Winpe_x86\ISO

    \Winpe_x86\Mount

  3. Copy the base image (Winpe.wim) into the \Winpe_x86\ISO\sources folder, and rename the file to Boot.wim.

    copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim
    

Step 2: Add additional customizations

This step is optional but recommended.

You can use ImageX to add applications and scripts to your Windows PE image that you might need while working in Windows PE. ImageX is a tool for capturing and applying images during deployment scenarios. For example, type the following command to copy the ImageX tool to the Windows PE image.

copy "c:\program files\<version>\Tools\x86\ImageX.exe" c:\winpe_x86\iso\

Step 3: Prepare the UFD

Before you can place Windows PE on a UFD, you must format the UFD using the version of DiskPart from Microsoft Vista, Windows 7 or Windows PE 2.0 or higher.

  1. From a running valid operating system or Windows PE session, insert your UFD.

  2. At a command prompt, use Diskpart to format the UFD as FAT32 spanning the entire UFD, and set the partition as active. For example,

    diskpart
    select disk 1
    clean
    create partition primary
    select partition 1
    active
    format quick fs=fat32
    assign
    exit
    

    The example above assumes Disk 1 is the UFD.

  3. On your technician computer, copy all of the content in the \ISO directory onto your UFD. You can manually create the directory structure or use the xcopy command to automatically build and to copy the appropriate files from your technician computer to your UFD. For example,

    xcopy C:\winpe_x86\iso\*.* /e F:\
    

    where C is the letter of your technician computer hard disk, and F is the letter of your UFD.

Next Steps

You can also place Windows PE RAM on other bootable media, such as a CD-ROM or a hard disk. For more information, see Windows PE Walkthroughs.

To load an application or a script into memory with Windows PE, you must create a custom Windows PE image. For more information, see Walkthrough: Create a Custom Windows PE Image.

Note

This configuration boots directly into memory and is assigned the drive letter X, which does not correspond to the media (the UFD or CD-ROM) from which you booted. You can set the drive letter using the DISM /Set-TargetPath option. Ensure that you have sufficient memory to support the size of your Windows PE image, plus any additional memory requirements; for example, if you plan on running any customized applications that need additional working memory.

See Also

Concepts

Booting Windows PE