Create WinPE Using WAIK for Windows 7

Before you start

Objectives: learn how to create WinPE CD which includes ImageX, by using WAIK for Windows 7, so you can capture and deploy Windows 7 images.

Prerequisites: you have to have WAIK tools installed on your system. You also have to know how tomount and unmount images using ImageX.

Key terms: image, winpe, iso, imagex, mount, deployment, cmd, oscdimg


Run Deployment Tools CMD

As you already know, we have to have WAIK installed on our system. WAIK contains Deployment Tools CMD which we will use to create our WinPE ISO. To run Deployment Tools CMD go to Start > All Programs > Microsoft Windows AIK > Deployment Tools Command Prompt.

Create WinPE ISO

Deployment Tools Command Prompt will automatically take us to the PETools folder. Here we will run ‘copype‘ command, and specify 32bit system (with x86), and specify a folder where our WinPE will be saved (in our case C:\wpe). The command looks like this: ‘copype x86 c:\wpe‘.

copype Finished Successfully

Image 186.1 – copype Finished Successfully

Once the files are copied we are automatically transferred to the c:\wpe folder. Let’s see the content of that folder using the ‘dir’ command.

wpe Folder Content

Image 186.2 – wpe Folder Content

In our C:\wpe folder we see that we have ISO folder, which is the folder that we will burn to an image. Also we have default winpe.wim file, and we have etfsboot.com file (which is boot manager).

The next step is to open wimpe.wim image file and copy files that we want into that image. The main thing that we want to copy to winpe.wim is the ImageX tool. To do that we will open second command prompt with elevated privileges (right-click CMD, then select ‘Run as administrator’). In that second CMD we will go to the ‘c:\program files\windows aik\tools\‘ folder. Use the ‘dir’ command to check the content of that folder. What we need to do next is use the ImageX command to mount the c:\wpefolder. Before we do that we have to create a folder to mount it to. In our case we will create c:\wpemfolder.

Wpem Folder

Image 186.3 – wpem Folder Created

ImageX for 32bit systems is located in the ‘x86’ folder, so we will open it. Next, we will use ImageXcommand with /mountrw switch. /mountrw will make our mount readable and writable. We will also choose our winpe.wim file, boot the first installation in it (option 1), and choose our output folder (c:\wpem). The final command looks like this: ‘imagex /mountrw c:\wpe\winpe.wim 1 c:\wpem‘.

Mounting Process

Image 186.4 – Mounting Process

The content from the c:\wpe folder was mounted to the c:\wpem folder. When the mount is complete we can browse to the c:\wpem folder and see the content of the image.

Wpem Folder

Image 186.5 – wpem Folder

Now we have to copy ImageX from the ‘C:\Program Files\Windows AIK\Tools\x86‘ folder to our ‘c:\wpem’ folder.

ImageX Copied

Image 186.6 – ImageX Copied

Now we can unmount the image and commit changes. Remember that we can also copy other data, tools, drivers or anything else that we want to have available once we boot up with that WinPE image. To unmount the image let’s go to the command prompt and run the following command: ‘imagex /unmount /commit c:\wpem‘.

Committing Changes and Unmounting

Image 186.7 – Committing Changes and Unmounting

What really happened is that the content of the c:\wpem folder (mount) was saved to the windows image. Image was then unmounted and saved to the winpe.wim file.

Next, we are going to copy c:\wpe\winpe.wim file to the c:\wpe\ISO\sources folder and change the name to boot.wim. We can do this using Windows Explorer. The ‘sources‘ folder of every Windows 7 installation contains two important files: install.wim and boot.wim. The boot.wim is for booting the DVD and starting the installation. Install.wim stores the actuall installation files. At this poing we can create ISO image from our prepared folder. The WAIK has a tool called oscdimg (Operating System CD Image) creator which we can use to create ISO images from data on our hard drive. Let’s go back to Deployment Tools Command Prompt and run the oscdimg command. We will specify -n for long file names, specify the source folder, specify destination file, and also specify the boot files which will be included in the boot sector (-b), so that our image will be bootable. The whole command is: ‘oscdimg -n c:\wpe\iso c:\wpe\winpe.iso -b”c:\wpe\etfsboot.com‘.

oscdimg Complete

Image 186.8 – oscdimg Complete

Once the ISO image is complete we can burn it to a CD or DVD, which we can then use to boot our computer from.

Remember

Using WAIK tools, we have to prepare WinPE ISO before we can capture reference computer. Our WinPE ISO has to contain ImageX tool, which we will use to caputre Windows image.

Commands that are mentioned in this article
  • copype x86 c:\wpe – creates a destination folder, which contains the WINPE.WIM file, a MOUNT folder you can use to mount the WIM using ImageX or DISM, an ISO folder that contains all the files needed to create a WinPE ISO image, and the BIN file needed to make the ISO bootable
  • md c:\wpem – make new directory named ‘wpem’ in c:\ folder.
  • imagex /mountrw c:\wpe\winpe.wim 1 c:\wpem – used to mount the winpe.wim image (first installation) to the c:\wpem folder with read and write permissions.
  • imagex /unmount /commit c:\wpem – unmount image and commit all changes
  • oscdimg -n c:\wpe\iso c:\wpe\winpe.iso -b”c:\wpe\etfsboot.com – create ISO image from files in the ‘iso’ folder and include boot files. Destination file is ‘winpe.iso’
Paths that are mentioned in this article
  • Start > All Programs > Microsoft Windows AIK > Deployment Tools Command Prompt – path to the CMD which will automatically include paths for dism, oscdimg and imagex
  • c:\wpe – folder in which we copied WinPE
  • c:\program files\windows aik\tools\ – path to the WAIK tools
  • c:\wpem – folder which we used to mount winpe.wim image.
  • c:\wpe\ISO\ – folder which we used to create the final WinPE ISO file