How to Create a WIM System Image Using WindowsAIK and WindowsPE

WIM System Image File Overview

A system image is a single file that contains the entire operating system and all of the files, programs, and settings of an installed computer system. Network administrators use system images to deploy the Windows 7 operating system to many computers in a Windows network. Besides just deploying operating systems across a large network, a system image is also be a useful backup tool for re-imaging corrupted systems. A Windows 7 system image file is called a WIM file, it has a .wim file extension. A WIM file can be created in such a way (generalized) that it can be deployed to any computer independent of the particular hardware or drivers.

In this tutorial, I attempt to simplify the process of creating a Windows system image or WIM file, into easy to understand, step-by-step instructions. I hope you find the tutorial helpful and the process interesting! I have also added video tutorials showing how to do the entire process using a VMware Windows 7 virtual machine as the reference computer.

The tools you will need:

  • The Reference Computer – A computer with Windows 7 installed. This is the source computer that the image file will be created from. In my example, I used a fresh install of Windows 7 on an extra computer, then I ran updates, installed a couple programs, changed the desktop and the homepage, and took a screenshot (see below). Important! The first time you do this, I do not recommend using the Windows 7 home computer that you use on a daily basis, as the reference computer. This process will involve a generalizing of the system (sysprep) which will strip it of drivers, as well as the System ID. Though everything will be put back to normal, I do not recommend using a machine that you rely on the first time you do this exercise. I am also in the process of showing how this entire lab can be done using virtual machines.

    This is a screenshot of the system I am going to image.

  • The Technician Computer – In my case running Windows 7. This is the computer with Windows AIK installed.
  • A USB flash drive or CD – To hold your bootable WinPE image.
  • A USB external drive or flash drive – To store your WIM system image files (Note: a WIM file can be as large as the hard drive your imaging){loadposition adposition6}
  • Windows Automated Installation Kit (Windows AIK) – Used to create and maintain Windows system images or WIM files. Windows AIK is a free download from Microsoft that you will need to burn to DVD and then install. Windows AIK includes the following tools:
    • Windows PE – The Windows preinstallation environment is a thin version
      of Windows 7 based on the Windows 7 kernel. Windows PE is like a Windows
      7 Boot Disk. It can be used to fix Windows 7 installations.
    • Windows SIM – Windows System Image Manager creates ‘answer files’ that are used to automate the Windows installation (This is optional, I do not use this tool in this tutorial).
    • SysPrep Tool – The System Preparation Tool is used to generalize the system image for installation by removing specific computer system information. (The SysPrep tool is included in Windows 7)
    • ImageX – Command line tool that creates the image file. In this tutorial, we will copy the ImageX.exe file to the root of the USB WindowsPE boot drive, for easy access.

Initial Steps

In this tutorial you want to pay close attention to the syntax of the commands (eg. the spaces between words or characters)

  1. Set up the ‘Reference Computer’ with Windows 7. This is the computer I will use to create my “golden image. (see above recommendations)
  2. Download the Windows Automated Installation Kit for Windows 7 iso file. You can download it here: Once you have it downloaded you will need to burn it to a DVD. Now install WindowAIK from the DVD (If it does not start by itself run the StartCD.exe file located on the DVD)
  3. For good online instructions I recommend going to This is my starting point for this tutorial:

Create a Windows PE Boot Disk (USB Flash Drive or CD)

  1. Next, you need to make a Windows pre-installation environment, Windows PE boot disk. You can do this on a CD-ROM or a USB flash drive, I show both ways in the steps below . You can also find more information on how to create WindowsPE boot disks at the Microsoft TechNet website: I have also included a video tutorial on how to create a WindowsPE boot CD below.
  2. On your technician computer (computer with AIK installed), click:
    Start > All
    Programs > Microsoft Windows AIK
    , right-click Deployment Tools Command
    , and then select Run as administrator.
  3. At the command prompt, run the Copype.cmd script. The script requires two additional parameters: hardware architecture and destination location.
    copype.cmd <arch> <destination>
    <arch> can be x86, amd64, or ia64 and <destination> is a path to local directory. For example, I typed in the following command:
    copype.cmd x86 c:\winpe_x86 (the directory winpe_x86 will be created by the command)
  4. Next, run the following command to copy and rename the winpe.wim file:
    copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim
  5. Add ImageX.exe to your WinPE image (optional but recommended). Type the following command:
    copy c:\<the path to WindowsAIK>\tools\x86\imagex.exe c:\winpe_x86\iso\
    On my computer, I installed AIK directly to the c: drive in a folder named “WindowsAIK” instead of the “Program Files” folder so my command looked like this:
    copy c:\WindowsAIK\tools\x86\imagex.exe c:\winpe_x86\iso\
  6. Now you need to decide if you want to prepare a USB flash drive or a CD for accepting WindowsPE. If you want to prepare for burning a CD, you can skip to step 9, otherwise continue on. Now you need to prepare your USB Flash Drive. Insert your flash drive. Open a command prompt and type in the following command:
    diskpart (opens the diskpartition command line utility)
    When you see the prompt “DISKPART>” type in the following command to verify which disk is your USB Flash Drive:
    list disk (you should see a listing of disks based on size)
    Type in the following commands (Important: this assumes your USB drive was listed as “Disk 1” you don’t want to format the wrong disk)
    select disk 1
    create partition primary
    select partition 1
    format quick fs=fat32

    Now your USB flash drive should be formatted with fat32.
  7. Copy the iso directory in your c:\winpe_x86 folder to your Flash drive. Type in the following commands:
    xcopy C:\winpe_x86\iso\*.* /e F:\
    the above command assumes your f: drive is your USB drive, else adjust accordingly
  8. Congratulations! You just created your Windows PE Boot Flash Drive. Now you need to capture a generalized image for deployment.
  9. If you would like to burn
    WindowsPE to a CD instead of a USB thumb drive. The following command will copy all of the files necessary to create a WindowsPE boot disc into an ISO image file. Then you can burn the image file to a CD to create a bootable WindowsPE CD. In the command below the ISO image file that you will want to burn is winpex86.iso
    Oscdimg -n -bC:\winpe_x86\ C:\winpe_x86\ISO C:\winpe_x86\winpex86.iso
  10. Now burn the ISO image file winpex86.iso to a CD as a bootable image disc and you are finished! You can find more
    information on how to do it from the Microsoft Technet site here: .
  11. Congratulations! You just created your Windows PE Boot CD. Now you need to capture a generalized image for deployment.

How to Create a WindowsPE boot cd using Windows AIK

Generalize your Windows 7 Reference Computer with SysPrep

  1. Generalize your image with the SysPrep utility.
  2. On the reference computer. Click Start > All Programs > Accessories > Right Click the Command Prompt. Opens the command prompt in administrative mode. Type in the following command to run sysprep:
  3. In the sysprep dialogue box choose the OOBE, generalize, and shutdown options and click “ok”.
  4. Sysprep will prepare your system for imaging by stripping it of hardware specific settings and will then shutdown.

Generalize the reference system using the SysPrep utility

Capture an Image for Deployment (Generalized Golden Image) with ImageX

  1. Now that you have generalized your Windows 7 Reference System you need to boot the reference computer to your WindowsPE Boot Disk (USB or CD). If you are doing the lab on a VMware virtual machine you can configure the virtual CD/DVD drive to boot directly to the WindowsPE .iso file. You will still need to tell the virtual machine to boot the CD/DVD drive by quickly clicking inside the VM as it boots and hitting the escape key on the keyboard in order to get to the boot menu. Working from a physical computer, you need to press the F12 key while starting the computer in order to bring up a one-time boot menu, and set the computer to boot to the CD/DVD or USB flash drive instead of the hard drive.
    Note: If you boot to the hard drive instead of your WindowsPE USB then your computer will begin the Windows setup procedure and load pnp drivers, and you will need to do sysprep all over again to generalize your system.
  2. In the WinPE command prompt run diskpartition by typing in the command: diskpart (and hitting enter)
  3. Type in the following command: list disk (to see your recognized disks)
    I showed 3 hard disk drives listed:disk0 = my hard drivedisk1 = my USB flash drivedisk2 = my larger external USB drive where I plan on saving my image file
  4. Type in the command: exit to exit disk partition
  5. Now I recommend figuring out which disks are under which drive letters. You can do this by executing the following commands:
    c:\ (switching to the c drive I found “Volume in drive C is System reserved”)
    d:\ (switching to the d drive I found the files and folders of a WindowsOS, i.e Program Files, Users, Windows, autoexec.bat, etc.)
    e:\ (depending on whether you are using a WindowsPE CD or a USB boot drive, switching to the e:\ drive you may find the contents of the WindowsPE drive or a “The device is not ready” message)
    f:\ (under the f drive I found the WindowsPE drive and the imagex.exe file)
    g:\ (under the g drive I found my USB external hard drive where I am going to store my image file)
  6. Once you know where imagex.exe is located (USB WinPE drive) you can run it on your generalized Win7 drive and save the image an external storage device. My final command to create the image and save it to an external hard drive was:
    f:\imagex /capture d:\ g:\my-windows-image.wim “myImage” (make sure you put the quotation marks)
    Explanation of command above: after using the cd and dir commands to search around the disks and directiories I found the imagex.exe file in the F:\ drive. The separate pieces of the command are as follows:
    f:\imagex (is where imagex.exe was located)
    /capture (the argument that tells imagex to capture the image)
    d:\ (location of the drive with the generalized Windows 7 OS)
    g:\my-windows-image.wim “myImage” (location of drive to save the image file (in this case an external USB drive), the file name to give it, and a label name)
  7. Now check to see if the image successfully copied to your external USB drive. You should see a .wim file. If you did, congratulations, you now have an image file of your entire Window 7 operating system, which includes installed programs, documents, and configurations! You can now install that image on a different computer, the same computer, or you could open that image file with the Windows AIK program and mount the image like an external hard drive. A mounted wim file can be browsed, edited or added to.

Capture the WIM from WindowsPE, using ImageX

Installing/Deploying your WIM Image to a Computer or Network with ImageX

  1. Now that you have your image file you can install it to another computer using ImageX!
  2. Boot a computer to your USB WindowsPE boot drive.
  3. Attach the USB external drive with your wim file.
  4. Format the drive using Diskpartition. After typing diskpart you will need to search the drives to verify which letters correspond with which drives. Here are the commands:
    diskpart (starts Disk Partition)
    list disk (lists the mounted disks, note which one is which by comparing sizes)
    select disk 0 (select the disk that corresponds with your hard drive where you want to install your image)
    create partition primary
    select partition 1
    format quick fs=ntfs label=OS
    (Important: NTFS not fat32, label is optional)
    assign letter=C (Important: you want it to be the C drive)
    Now run the command to apply the image to the hard drive:
    f:\imagex.exe /apply e:\my-windows-image.wim 1 c:\
    /apply (apply instead of capture)
    e:\my-windows-image.wim 1 (Important: the 1 is the index of the first wim. Each wim can have multiple versions)
    c:\ (where you will install the wim)
    Once the image is done you can try restarting and seeing if the system boots normally. If it doesn’t you will need to set up the boot configuration location. In WindowsPE type the following commands:
    c: (to switch to the c drive)
    cd windows\system32
    dir bcd* (list all the files beginning with bcd)
    bcdedit.exe (looks for boot files)
    bcdboot c:\windows /s c: (sets the system boot boot directory)
  5. Restart your computer and go to Windows setup mode. You will need to add a new user in setup mode which you can delete later. Log off and log back into your original user account and you should see all your programs, documents and settings! Image is restored!

Week 6 – Applications Part 1

Week 6 LabSim Assignment

Complete the first part of Section 4.0 in your LabSim Windows Client Pro course material, this week will focus on the following subsections:

  • 4.1 Desktop Applications,
  • 4.2 User Account Control,
  • 4.3 Application Compatibility

Make sure you watch all the lectures and demonstration videos too.

Week 5 – Hardware Management Part 2

Week 5 LabSim Assignment

Complete the second part of Section 2.0 in your LabSim Windows Client Pro course material, this week will focus on the following subsections:

  • 2.4 Storage Spaces,
  • 2.5 Disk Optimization,
  • 2.6 Removable Storage,
  • 2.7 Skydrive Storage

Make sure to watch all the lectures and demonstration videos too.

Week 3 – Install Windows 8


This week you will install Windows 8 Professional. Most computers and laptops come with the operating systems pre-installed, so there is a high chance that you have never installed Windows 8.  If your personal computer already has Windows 8, try to install a fresh version of Windows 8 Pro on a computer in the lab, or on another computer at home, or possibly in a virtual machine using the free VMware Player from

Week 3 Assignment

Complete the following parts of Section 6.0 in your LabSim course material. This will include:

  • 6.3 Windows 8 Installation
  • 6.4 Windows Upgrade

The LabSim curriculum will consist of materials to read, videos demonstrations to watch, and interactive simulations to accomplish. At the end of some of the chapter subsections there are multiple choice exams. All of these tasks to be accomplished can be retaken and you will find yourself redoing some of them more than once or even twice. This is not a bad thing. I will be able to chart your progress through TestOut.

Week 3 Non-LabSim Assignment – Install Windows 8

Install or upgrade a computer system to Windows 8. Consider applying what you learn in the LabSim Section 6.4, and perform a system upgrade to Windows 8.

Check your email – Windows Client students you should be receiving an email from Debbie Kayser with your MSDN Alliance Username and Password. That account will enable you to request and download Microsoft Software because you are a student at Sheridan College. When you get your MSDN alliance account email: 

  • 1) An account with the MSDN Alliance 
  • 2) A download link to download Windows 8, and 
  • 3) Dont forget to write down the serial/license number for the operating system, when you see it in the pop-up browser window. 


  1. login to your MSDN Alliance account (see your recent email) and
  2. Click on the link to the Operating System you need to download this will open a pop-up window
  3. The pop-up window will have the serial/key number (write it down) and a download button, click it when you are ready to download. It will take a long time to download (If you have slow internet I can always burn you a copy of mine).
  4. The download button will download a small executable installer file. Download it to your desktop and double click on it to run it. It will save to a recommended location. My download defaulted to C:\temp\ directory. When the download is finished (LONG TIME) there should be an .iso image file which you can then burn to a DVD as a bootable image file.
  5. To burn the disk use Nero, Roxio, or ImgBurn which is a free program to burn a bootable disc from an .iso image file. Look for a choice like Copy Disc or Create Image, not create a Data Disc.

Turning It In
Due Date: End of Week 4

Your assignment is complete once you have set a unique desktop background and sent me a screenshot of your Windows 8 desktop. Save the screenshot as a JPG image file, and send it to me as an email attachment.


Week 16 – Update, Backup, and Recovery

Week 16 LabSim Assignment

Complete section 10.0 in your LabSim Windows Client Pro course material. Complete the following subsections:

  • 10.1 System Updates
  • 10.2 Update Deployment and Management
  • 10.3 System Backup
  • 10.4 Windows 7 Data Recovery,
  • 10.5 Windows 8 Data Recovery,
  • 10.6 System Recovery

Week 16 Non-LabSim Assignment – Change the Default Logon Screen in Windows 7

This is something fun and easy to do. Inspired by Wade’s computer in the lab. See my video tutorial on how to do it…

Turning it in:
Due date:
End of Week 16 post a JPG screenshot or digital photograph (low res) of your logon screen to the DansCourses Forum.



Week 15 – System Monitoring

Week 15 LabSim Assignment

Complete Section 9.0 in your LabSim Windows Client Pro course material. Complete the following subsections:

  • 9.1 Troubleshooting Tools,
  • 9.2 System Events,
  • 9.3 Performance Monitoring,
  • 9.4 Resource Monitoring,
  • 9.5 Reliability and Performance Maintenance,
  • 9.6 Optimization
  • 9.7 Remote Management,
  • 9.8 Remote Assistance,