How To Image, Sysprep and Deploy Windows 7 a Complete Guide – Using sysprep and Imagex

Starting with Windows Vista and continuing into Windows 7. Is the ability to image a machine and to have the Windows installer use that image to install Windows. This negates the need for an image for each hardware configuration. Or the use of any third party software

This guide will show you how to create and image from scratch then prepare it for your domain using sysprep. Then how to install Windows 7 from this image.

Index

Getting Ready
Create WINPE Disk
SYSPREP your machine (For Domains)
Capture the Image
Create new Install Media

Related

How to copy the default profile and setup for domains
How to install Windows 7 from a USB stick using XP
Generate an unattend.xml file for unattended installation
Use WDS for Windows 7 Imaging (New Article)
Get Help in our Forums


Getting Ready

  • Install Windows 7 from scratch on to your test machine. DO NOT upgrade from Windows XP, this needs to be a fresh install.
  • Customise Windows 7 with any software, security settings or general settings you wish. When you install from this image all the settings as well as user accounts will be installed by default.
  • Install WAIK for 7/2008 on the test PC. Download from here (1.7GB).

Create WINPE Disk

  • Right click command prompt run as admin
run as admin
  • Change to directory “C:\Program Files\Windows AIK\Tools\PETools”
  • run command “copype x86 c:\winpe”
petools
  • run command “imagex /mountrw c:\winpe\winpe.wim 1 c:\winpe\mount”
imagex command
  • copy imagex.exe from “C:\Program Files\Windows AIK\Tools\x86\imagex.exe” to “c:\winpe\mount\windows\system32″
copy imagex
  • Create wimscript.ini in “c:\winpe\mount\windows\system32″ with following inside
  • [ExclusionList]
    ntfs.log
    hiberfil.sys
    pagefile.sys
    "System Volume Information"
    RECYCLER
    Windows\CSC
    [CompressionExclusionList]
    *.mp3
    *.zip
    *.cab
    \WINDOWS\inf\*.pnf
    
  • Run Command “imagex.exe /unmount /commit c:\winpe\mount”
imagex command commit
  • Run Command “copy c:\winpe\winpe.wim c:\winpe\iso\sources\boot.wim /y”
  • Run Command “oscdimg -n -h -bc:\winpe\etfsboot.com c:\winpe\iso c:\winpe\winpe.iso”
winpe command
  • This will create an ISO in c:\winpe\winpe.iso.
    Burn this and keep. Now we need to sysprep our machine.
    (You can remove WAIK and any files you don’t need, test your iso first!)

Sysprep Your Machine

  • change to the folder “c:\windows\system32\sysprep\”
change directory sysprep
  • run command “sysprep /generalize /oobe /shutdown”
  • If you want to use run an unattended installation you can run the following command sysprep /generalize /oobe /shutdown /unattend:unattend.xml (The unattend.xml will need to be in the sysprep folder). Check out the unattend.xml generator
  • Sysprep will remove any unique information and reseal the OS. Then the system will shutdown
  • sysprep Windows 7
  • Now boot the ISO we created previously and load into WinPE

Capture Image

  • Once WinPE is booted you will be in a Command Prompt window
  • Run Command “diskpart”
  • Run Command “select disk 0″
  • Run Command “list volume”
  • Note the letter of the drive you are imaging. C:\ in WinPE is set as the running OS not as the internal HDD
  • Run Command “exit”
  • Run Command “imagex /capture d:\ d:\install.wim “My Windows partition”" where d:\ is the drive you are copying
  • This will create a file called install.wim in the root of your HDD. This is the custom image and will need to be added to the Windows 7 Install DVD

Create Installation Media

  • You will probably need to install from USB as the image will probably be to large for a DVD. Here is a guide for Windows 7 USB Install
  • overwrite install.wim to \sources on the windows 7 install source
  • If you didn’t use the sysprep to include unattend.xml you can also add it directly to the root of the install media. You can easily Generate an unattend.xml here
Install.wim windows 7

Install Windows 7 as normal. Your changes will be installed along with Windows 7

Trackbacks

162 Comments (Newest on top)

  1. Benji_9 says:

    Hi again, I managed with Sysprep, it was probably something with the HP installation, I tried e fresh Win 7 inst. at it worked with Sysprep.

    I took a backup image with Acronis and booted with a Acronis Universal Restore CD and Recovered with the Image i took, think it’s much more easier than all of the commands and programs since we’re going to use the Acronis software anyway..

  2. Toby Reynolds says:

    nice tutorial
    however after running sysprep with the generalise switch it boots past the bootscreen, but then says ‘Windows could not finish configuring the system. To attempt to resume configuration restart the computer’
    and it is on a contrinuous loop and i had to reinstall windows 7

    • Ben says:

      When installing Windows 7 you need to delete and format a new partition.
      Your error is related to files still being on the disk, not sysprep or the image :)

      • Toby Reynolds says:

        Sorry but this is what i have already done

        I have also followed your guide about installing off of a USB stick which has gone ok, but after the first reboot, I get that same exact error message

        Each time I have deleted all partition, clicked on new then install but i suppose because i used the new install.wim file (4gb in size) it booted straight to that error ‘Windows could not finish configuring the system. To attempt to resume configuration restart the computer’

        Any other ideas?
        cheers

        • Ben says:

          It could also be a problem with some of the software you preinstalled?
          Some AV can cause this error.

          Are you using a fresh install of Windows 7?
          This error can also crop up when using an OEM install such as one from dell as they already sysprep it.

          Sysprep can be run a maximum of three times on one image

        • Toby Reynolds says:

          well we have installed an unactivated version of the anti virus software that we use, microsoft office as well as our remote access software

          we were using enterprise edition of windows 7 32bit

          but thanks for your help

  3. Brian says:

    Hi Ben,

    For our antivirus we need to regenerate, well, lets call it another SID, for the antivirus on each machine when we run from an image. There is a program that on XP we would put in sysprep which would sort this out for us.

    Where would I put this on a Windows 7 machine?

    • Ben says:

      regenerating the SID is done by sysprep.

      Or are you referring to the av?

      • Brian says:

        Yeah, i’m talking about the AV. I can’t remember what the individual identifier is called!

        On XP it would be included in the sysprep folder and sort itself out.

  4. indi says:

    great its work

  5. Shenkt says:

    I have machines with different hardware so I need a lot of different drivers to be installed when the image is deployed. Is there any way to do this automatically?
    Thanks