Skip to content


Preparing a custom image of Windows 7

I have written a detailed guide about preparing custom images for Windows XP before, and this time I am writing about preparing custom images of Windows 7 with the same technique.

The basic tool we use is the same – Sysprep. However, it is much easier in Windows 7 to create a custom image. I have ran across some weird problems, and I am including those details and solutions as well in this article.

How to Create a Custom Windows 7 Image?

To create a custom Windows 7 image, you will need 2 partitions (or 2 separate computers) and a Windows 7 CD/DVD as well as a USB disk to store the image. First partition (or computer) will be the technician machine, we will create some tools for imaging from this machine. The other partition (or machine) will be the system that will be imaged (reference computer).

Technician Machine (Or Partition)

  1. Install Windows 7 on technician machine.
  2. Download and install WAIK for Windows 7 (Windows Automated Installation Kit)
  3. You will need to create a bootable media (cd/usb) with ImageX to capture the image. Open WAIK Deployment Command Line (from Program File -> Windows Automated Installation Kit) as administrator. Create the ISO with the following commands: (Your folders may differ but the filenames should be the same)
    copype.cmd x86 c:\winpe_x86
    copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim
    copy "C:\program files\Windows AIK\imagex.exe" C:\winpe_x86\iso\
    oscdimg -n -bC:\winpe_x86\etfsboot.com C:\winpe_x86\ISO\ C:\winpe_x86\winpe_x86.iso
    
  4. Burn this ISO to a CD / DVD or a USB drive. You will use this later to capture the image.

Reference Machine (Or Partition)

  1. Install Windows 7 on the reference machine.
  2. Create a temporary use (let’s name it TEMPUSER)
  3. Install any applications you want to include in the image.
  4. Install any updates, and configure Windows as you like.
  5. After you install and configure everything, we will wrap up the system. But before that, we need to delete the temporary user profile that we created. Run Windows\System32\Sysprep\Sysprep.exe as administrator and select “Enter System Audit Mode” from the dropdown list. Also check “Generalize” option, and select “Reboot” as the shutdown option. This is your last chance to install any programs or do any configurations.
  6. When you close Sysprep, the system will restart automatically.
  7. After the system restarts, you log on automatically as Administrator. You can delete the TEMPUSER account from Control Panel -> User Accounts.
  8. Run Windows\System32\Sysprep\Sysprep.exe as administrator and select “Enter Out Of Box Experience (OOBE)” from the dropdown list. Also check “Generalize” option, and select “Shutdown” as the shutdown option. The system will shutdown after you close Sysprep

Now, boot the reference computer with the CD created by WAIK iso on technician machine. A command line will appear. Enter the following command to take the image


imagex /compress fast /check /scroll /capture C: D:\install.wim " Windows Professional" "Windows 7"

Make sure you get the correct paths. C: is the partition we want to take image of. D: is the USB drive which the image will be copied to.

After this step, you will have an image of the reference computer. Copy this to a network path or another partition as we will format the USB drive.

Now, boot to technician machine. Run WAIK Deployment Command Line as administrator. Enter the following command (taken from Microsoft Technet)

  • Launch the DiskPart utility by typing diskpart at the Start Menu.
  • Then run the list disk command to check the status of your drive.
  • Now run select disk 1 where the “1″ is actually the corresponding number of your USB drive.
  • Run clean.
  • Once the thumb drive is clean, you can run create partition primary.
  • Now make the partition active by entering active
  • Then you need to set up the file system as Fat32 by running format fs=fat32 quick (quick, of course, specifies that you want to perform a quick format to speed up the process).

After this step, copy everything from your original Windows 7 CD/DVD to the USB drive that you just formatted. Then, replace Sources\install.wim in the USB drive with the “install.wim” image file that you created from the reference computer (remember you saved it somewhere :) )

Congratulations, you have successfully created a Windows 7 image. You can now boot any computer from your USB drive and install your custom image.

Troubleshooting

  • After Sysprep reboots (or after installation of the image), Windows gives this error : “Windows could not finish configuring the system. To attempt to resume configuration, restart the computer. “

Your image may contain a rootkit or a similar program that causes this error. In my experience, these things helped overcoming this error:

  • Make sure you don’t have Daemon Tools or Alcohol %120 like applications. These applications install a driver called SPTD which causes this error. You can remove SPTD by downloading and installing the installer from here.
  • Make sure you configure settings of your anti-virus product. I have seen that Kaspersky or ALG or Avira can cause these issues. Simply deactivate e the Self-Defense and Proactive Defense (or similar defense mechanisms) options and try again.
  • If still can’t fix it, make sure you format the reference partition with Windows 7 (and it’s totally formatted and clean, i.e no other files exist before installation) I’ve seen that formatting via other tools (i.e Windows 2000 disc) may cause this error.

Enjoy Imaging,

Bora Bilgin

Posted in Operating Systems and Software.

Tagged with , , , .


3 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. james mikusi says

    wow- i thought either MDT was crap, or my years of experience were proving fruitless.

    i prepped and imaged over and over again only to have it fail after first boot. i’m a big fan of kaspersky… but your post revealed it as the culprit of failed custom images.

    as logic would suggest, building an image fully scanned and with the most recent antivirus database would save the most post-install time. but once i removed kaspersky from my custom images they deployed just as they should.

    thanks for bringing clarity to the problematic nature of kaspersky when imaging.

  2. Bruno says

    Hello, after Step 5 on the Reference machine part, the one where the PC reboots after syspre.exe, windows crashed. It cannot start. Does it mean I miss all the custom stuff and updating I did? Is there any way to rollback this? Thx

  3. jack roberts says

    This is the most backwards imaging process known to man.

    Microsoft went out of their way to make it as annoying and non useful as possible.



Some HTML is OK

or, reply to this post via trackback.



Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
This work by Bora Bilgin is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported.