Walkthrough: Create a Bootable Windows PE RAM Disk on UFD
The document is archived and information here might be outdated

Walkthrough: Create a Bootable Windows PE RAM Disk on UFD

This walkthrough describes how you can create a bootable Windows PE RAM disk on a USB flash drive (UFD) device by using the Copype.cmd script. 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.

This method boots directly into memory and is assigned the drive letter X, which does not correspond to the media (UFD, CD-ROM) from which you booted. 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.
If you use a UFD device to initiate a Windows Vista installation, you must leave the UFD device in the computer until Windows Vista Setup has successfully completed the Windows PE phase of setup. If you remove the UFD device prior to disk configuration (Windows PE phase), setup fails.


To complete this walkthrough, you need the following:

  • A technician computer, which provides all the tools and the source files. For more information, see Building a Technician Computer.
  • Access to a computer running Windows Vista or a Windows PE session.
  • A UFD device. The size of the UFD device must be at least 64 megabytes (MB) larger than your Windows PE image plus 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, and then click Windows PE Tools Command Prompt.
    The menu shortcut opens a command prompt window and automatically sets environment variables to point to all the necessary tools. By default, all tools are installed at C:\Program Files\<version>\Tools, where <version> 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 the necessary files for that architecture. For example,

Step 2: Add additional customizations

This step is optional but recommended. You can add applications and scripts to your Windows PE image that you might need while working in Windows PE. The following are common tools to include in your Windows PE image.

  • ImageX
    A tool for capturing and applying images during deployment scenarios. For example,
    copy “c:\program files\<version>\Tools\x86\imagex.exe” c:\winpe_x86\iso\
  • Package Manager (Pkgmgr.exe)
    A tool for servicing Windows images (.wim) offline. You must copy the entire \Servicing folder and MSXML 6 binaries. Offline servicing requires ImageX. For example,
    xcopy “c:\program files\<version>\Tools\<architecture>\Servicing” c:\winpe_x86\iso\Servicing /s
    copy %windir%\system32\msxml6*.dll c:\winpe_x86\iso\Servicing
    where <version> can be Windows OPK or Windows AIK and <architecture> can be x86, amd64, or ia64.

In both examples, the tools are not loaded into memory during a Windows PE RAM boot. The media must be available to access the tools.

Step 3: Create an exclusion list

This step is optional but recommended if you include ImageX as part of your Windows PE image. During an ImageX capture operation, some files might be locked, which causes ImageX to fail. You can exclude specific files from being captured by creating a configuration text file called Wimscript.ini. The following is a sample configuration file that includes common files that you must exclude during a capture operation.

"System Volume Information"


Add additional files or directories that you intend to exclude during a capture operation. For more information about configuration files, see Create an ImageX Configuration File.

Save the configuration file to the same location as ImageX as specified in Step 2. For example,


ImageX will automatically detect Wimscript.ini only if it is saved to the same location.

Step 4: Prepare UFD device

Before you can place Windows PE on a USB flash drive (UFD) device, you must use Diskpart to format the UFD with a Windows Vista or Windows PE environment.

  1. From a running Windows Vista operation system or Windows PE session, insert your UFD device.
  2. At a command prompt, use Diskpart to format the device as FAT32 spanning the entire device, and set the partition as active. For example,
    select disk 1
    create partition primary size=<size of device>
    select partition 1
    format fs=fat32
    The example above assumes Disk 1 is the UFD.
  3. On your technician computer, copy all the content in the \ISO directory onto your UFD device. 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 device. For example,
    xcopy c:\winpe_x86\iso\*.* /s /e /f f:\
    where c is the letter of your technician computer hard disk and f is the letter of your UFD device.

Next Step

You can also place Windows PE RAM on other bootable media, like 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.

See Also

© 2016 Microsoft