Sysprep a Windows 7 Machine – Start to Finish

This is the old version, please see the new Sysprep a Windows 7 Machine – Start to Finish V2.

Note – I highly recommend creating a boot or rescue disk before starting any windows 7 technical projects. There are many tools in the market and I use Spotmau BootSuite rescue software and boot disk utility because of it’s versatile features and top notch performance.

Windows 7 Sysprep

Last Updated on 10.04.12

This is a step by step guide on Sysprepping a Windows 7 machine from start to finish. I cannot take full credit on this because my first article had so many helpful comments and discussions that this is simply a combination of all the good advice written into a working guide. (I would especially like to thank George for his input on Cscript for auto activation and Nathan for input on Sysprep Audit Mode). This will guide you through the following:

  • Audit Mode
  • Building the unattend.xml file in WSIM
  • copyprofile=true command to copy the default profile (no manual copy)
  • Prompt for a computer name
  • Enable Administrator account
  • Administrator account logs in first time automatically
  • Activate windows automatically with Cscript;
  • Successfully copy over taskbar icons;
  • Delete unattend.xml file automatically upon completion of re-image.

Tip. In case you want to sysprep Windows 10, you can use our step-by-step guide.

Here is a list of what you will need:

First we are going to walk through building the unattend.xml file (answer file) and then we will walk through the actual Windows 7 imaging process.


Step 1

If you have a Windows 7 installation DVD, insert it now. Or if you have an ISO of 7, go ahead and extract it to a folder on your desktop. (I recommend 7-zip).

Step 2

Launch Windows System Image Manager. Your start menu should look like the image below:

Windows 7 WAIK Version 1

Step 3

Under the “Windows Image” header, right click and select new image.

Windows System Image Manager

Step 4

You will now want to browse to the .CLG file in your Windows 7 installation (I am using Windows 7 Enterprise x64 in my example). It is located in the sources folder. See Image below. You can select either the .clg file or the install.wim. Both will have the same result.

Selecting CLG File - WSIM

Step 5

Now we need to create a new answer file. Go to the file menu and select “Create New Answer File.” Right after creating one, go ahead and simply go to file menu and select “Save Answer File.” This will give your XML file a name and save location. I chose to name mine unattend.xml. Now you see we have two category folders, Components and Packages. Under the Components folder you see that we have 7 options:

  • 1 windowsPE
  • 2 offlineServicing
  • 3 generalize
  • 4 specialize
  • 5 auditSystem
  • 6 auditUser
  • 7 oobeSystem

Step 6

These are very important as these are the steps in which the unattend.xml file is sequenced.
The next part is a little confusing. You are going to add components, from under the “Windows Image” section on the bottom left hand side to the passes on your Answer File. To add a component, you can right click on them and select “add to # pass”. There are many different options you can add, but they have to be done in a certain order and pass otherwise your sysprep might fail. I am simply going to use the one I created as the example.

Answer File - Unattend.xml

Here is more information about adding options under the passes:

1 windowsPE

Nothing required in my example.

2 offlineServicing

Nothing required in my example.

3 generalize

Set 1 for SkipRearm to allow up to 8 rearms

4 specialize

Order: 1
path: net user administrator /active:yes
WillReboot: Never

SkipAutoActivation: true

Computer Name: Leave blank (we will deal with this at the end)
CopyProfile: true
Registered Organization: Microsoft (you must leave this in this section)
Registered Owner: AutoBVT (you must leave this in this section)
ShowWindowsLive: false
TimeZone: Pacific Standard Time

(Please view TimeZone settings here ->

You can delete other sub-header components if you don’t need them.

5 auditSystem

Nothing required in my example.

6 auditUser

Nothing required in my example.

7 oobeSystem


InputLocale: en-us
SystemLocale: en-us
UILanguage: en-us
UserLocale: en-us

RegisteredOrganization: Your Company Name
RegisteredOwner: Your Name

Password: Administrator Password

Enabled: true
LogonCount: 5
Username: administrator

CommandLine: cscript /b c:\windows\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX (windows 7 license key)
Order 1
RequiresUserInput: false
CommandLine: cscript /b c:\windows\system32\slmgr.vbs /ato
Order 2
RequiresUserInput: false


HideEULAPage: true
NetworkLocation: Home
ProtectYourPC: 1

Password: Administrator Password

Action: AddListItem
Description: Local Administrator
DisplayName: Administrator
Group: Administrators
Name: Administrator


AdministratorPassword: Administrator Password

If you have questions, look at my image above to see full layout of components, it should help.

Step 7

K, now go ahead and save your answer file as unattend.xml.

Step 8

If you want the sysprep to prompt for a computer name you need to remove a line from your XML file. Open up your XML file you saved with notepad and remove the following line:

Unattend.xml Computer Name


Step 9

Install Windows 7 (Enterprise) from CD or USB flash drive, when you arrive at the welcome screen and it asks you to create a username, hit ctrl+shift+f3.
This will reboot your machine and put your windows build in ‘audit’ mode.

Step 10

On reboot, you’ll automatically be logged in under the built-in Administrator account. A sysprep GUI box will appear, but you can close it and NOW begin to customize your profile.

Step 11

Install any software/drivers, make any profile customizations, etc.
If you need to reboot, the computer will boot you back into the Administrator account. You will be stuck in this audit mode until you run sysprep with the /oobe parameter. After doing so, sysprep will delete/clean up the Administrator account, but if you have copyprofile=true in your unattended answer file, it will copy the customized Admin account to the default profile before deleting it.

Step 12

On the PC you are going to be running sysprep on, you need to create a folder called scripts in this directory: %WINDIR%\Setup\. Now you are going to create a CMD file within the %WINDIR%\Setup\Scripts directory. Right click and make a new text file called SetupComplete.txt. Remove the .txt extension and replace that with .cmd. You now have a SetupComplete.cmd file which windows will read the first time it boots up from the sysprep. We need to place a script inside the CMD file. Edit the cmd file with notepad and insert this line: del /Q /F c:\windows\system32\sysprep\unattend.xml. This script will delete your unattend.xml file after it has been used. The unattend.xml file is also copied to the C:\Windows\Panther directory, so you will want to add a second line to the CMD file, del /Q /F c:\windows\panther\unattend.xml. If you have passwords or cd keys stored in that xml file you don’t have to worry about it being left on the computer.

UPDATE AS OF JUNE 16TH: Read my Taskbar Icons Tutorial before continuing.

Step 13

Once you have everything configured correctly, Copy or move your unattend.xml file to : C:\windows\system32\sysprep. Now to run sysprep, navigate to that sysprep folder, hold SHIFT and right click and select “Open New Command Windows Here”. Next, input the following commands:

sysprep /generalize /oobe /shutdown /unattend:unattend.xml

Step 14

Turn the computer back on and boot to WinPE 3.1 environment (USB stick or CD/DVD). You can use my theITBros WinPE3.1 BootLoader to boot up from USB or CD and capture your image. Capture image and save image to network location.
A Dell 960 or GX755 is a good standard for capturing when you want a generic image for use with multiple systems. Might require injecting additional drivers for 3rd party brands, HP, etc. Most should work though right out of the box.

Step 15

On reboot, Windows will run out of the box, as the /oobe is intended. As long as you put your cd key into the unattend.xml file, windows will be activated automatically in the background, you will be automatically logged into the administrator account, and the unattend.xml file is deleted. You are now ready to use the computer or join it to the domain. Enjoy!

You may also like:

Sysprep a Windows 7 Machine – Start to Finish V2 This is version 2 of a step by step guide on Sysprepping a Windows 7 machine from start to finish. I cannot take full credit on this because my first ...
DISM Tool – WinPE 3.1 Boot Environment This is the new tutorial for the recent release of WinPE 3.1. You can still read the old tutorial here. DISM Tool You will need the following to...
WinPE 3.1 Scripts WinPE 3.1 Scripts This latest version was compiled on September 27th, 2012. This is the third update to our WinPE scripts. Please read our tutorial o...
Copy Taskbar Icons Windows 7 Sysprep This is the old version, please see the new Copy Taskbar Icons Windows 7 Sysprep v2. Ok, you can thank a colleague of mine (Dinyero Johnson) for th...
Fix Corrupt Windows 7/8/10 Temporary Profile While working with Microsoft’s Windows 7/8 or Windows 10 operating systems you have noticed that sometimes when working with multiple profiles that th...
  • Long

    Hi Brian,

    Thanks for your hard work and it help me to complete my fist task…

    This is my second task question…
    I am using sysprep within the Altiris Deployement to capture and deploy the Windows* 7 and Vista* using the “unattend.xml” files to different laptops like HP, Lenovo, and Dell….
    A question is how to inject additional drivers for the above brands?

    • Chris Gralike

      Installing a additional drivers might be added using the dism toolset. Im not sure how this works with altaris, but you might try the manual i used to alter the boot.wim. (your index is prob 1) 😉

      # first create a directory called C:wim
      md C:wim

      # Next grab the *.wim from your WDS machine or the windows install CD.

      pushd \wdsservername.domain.extREMINST
      copy bootx64imagesboot.wim c:wim

      # Create a mount folder and mount the image.
      md c:wimmount
      dism /mount-wim /wimfile:c:wimboot.wim /index:1 (or 2?) /mount-dir:c:wimmount

      #next plug the driver into the image using dism
      dism /image:C:wimmount /add-driver /driver:C:delldriversR280807windows-7-x64E1k6264.inf

      The driver should be installed afterwards.

      # Commit all changes
      dism /unmount-wim /mount-dir:c:wimmount /commit

      Upload the boot.wim back to wds, and have a go with it!

      Hope this helps 🙂

      Rgrds, Chris

      • Christopher Denny

        I learned that for WIndows 7 create in your $1 a Windows\INF folder and drop any additional drivers you may need in here. WIndows 7 just may catch them and install automatically (works for me at least)

      • James

        Looks easy, but I don’t use Altiris. All I want to do is insert an Intel nic driver into the boot.wim and copy it back to my USB boot. Do you have a cleaner, more updated version of your instructions. The image is already mounted, but I get “incorrect syntax” and “unable to access the image” errors when trying to add a driver. And I have checked that the path to the inf file of the driver is correct. Thanks.

        • rebel47

          you can also add the driver paths directly into the registry a la
          sysprep on XP. navigate to
          HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersion and on the
          right pane edit the DevicePath value to include your driver paths,
          separating each with a semicolon. just be sure to leave in

    • Eric Hermecz

      I create a folder called drivers on the root of the drive and leave it empty. I then run a script in Altiris to copy the drivers for that particular model into that folder via WinPE. Altiris picks up the the baseboard model number from wmic so I use that number to reference what driver folder to copy over. Keep in mind that you will want to have the drivers copied to D:\ and not C:\ because of the partition Windows 7 puts on there. Altiris sees the boot partition as D. I also use this script to copy over my setupcomplete.cmd and dagent file that the setupcomplete installs. Here is an example of my script:

      @echo off
      REM Token Replacement Task for Unattend.xml File and Driver Placement
      REM Replacetokens .\Deploy\Scripts\windows7\classroom64\unattend.xml .\temp\%ID%.xml
      Echo Copying Updated Unattend.xml
      .\Rdeploy\Windows\firm.exe copy .\temp\%ID%.xml D:\windows\panther\unattend.xml

      REM Driver Copy Script
      echo Hardware Model Number is %#!computer@model_num%
      if “%#!computer@model_num%”==”0C27VV” goto 0C27VV
      if “%#!computer@model_num%”==”0GM819” goto 0GM819

      echo Copying Dell Optiplex 780 Driver files…
      .\Rdeploy\windows\FIRM.exe -recurse copy .\Drivers\780_64 D:\postinstall\drivers
      goto Common

      echo Copying Dell Optiplex 755 Driver files…
      .\Rdeploy\windows\FIRM.exe -recurse copy .\Drivers\755_64 D:\postinstall\drivers

      .\Rdeploy\windows\FIRM.exe -recurse copy .\Agents\Aclient\dagent_x64.msi D:\PostInstall
      .\Rdeploy\windows\FIRM.exe -recurse copy .\Sysprep\setupcomplete.cmd D:\Windows\Setup\Scripts\setupcomplete.cmd

      We have like 17 models but you get the point. Also, if you have Dell Optiplex or Latitude models, they have a driver cab file that has just about all drivers for those models which makes it much easier to maintain and add new machines to your jobs. I can’t take credit since I found this information somehwere and just changed it for my environment. Hope it helps.

    • Tim

      I discovered that you don’t have to mount an image, and that DISM can add drivers directly to your live image. So our imaging process is basically just a script that…

      -formats the drive
      -applies the sysprepped image.
      -copies over all the driver files to c:\drivers or whatever.
      -copy over the script file that installs any dell utilities like the dell support software, the freefall sensor, etc to be run after sysprep is finished
      -run dism to recursively search the c:\drivers folder and add any drivers found to the driver store.

      That way I don’t have to make a sysprep image for each type of computer I’ve got. I only need one sysprep image, then create a simple batch file for each model of pc that lays down the image, copies over the drivers for that model, DISM, then reboot.

  • I have not personally used Altiris before, but I’m curious, since it is a Symantec Product if Altiris has the “Deploy Anywhere” option? I would check this article out… it might help.

    • Eric Hermecz

      I am using Altiris 6.9 sp5 and deploy anywhere is only for NIC and mass storage drivers. As long as your answer file points to the folder you have Altiris copy your drivers to, it works great. I change the device path in the registry as well, but haven’t tested without it. I know you needed it with XP. I think they added support for all devices in 7.1. I will find out when we build the new server this month.

  • John

    I must be missing something here I have followed these steps and some found elsewhere and I keep ending up with “missing bootmgr” after loading the image. Then I have to insert the windows cd and repair the startup and everything works, but it would be nice to resolve this although with my image file setup it is still faster than loading everything individually.

    • aerilus

      probably due to the little 100mb repair partition that comes on most windows installs you need to move all the boot files over to the main partition, figure out how to capture two partition with image x (possible from what i can tell but i opted for the former with erd/msdart if i need to do any repair) or use sector based cloning software aka ghost

  • Here is one thing you can try… I noticed this solved similar issues for some people. When using GImageX to capture your image (.wim file). At the bottom of the fields where you are specifying destination, etc.. there is an options header. In there, there is a “Boot” checkbox. Try checking that, and then do a capture. Then apply your image, reboot, and see if you still have the “missing bootmgr” error.

    • David

      Hi Brian,
      After taking your advice I found that computers would still not boot, with the error
      ‘BOOTMGR is missing’ still occuring.
      Any other thoughts?

      • Antunes

        After you deploy the image do this in your command line

        C:\Windows\System32\bcdboot C:\Windows

        I usally do this two times just to make sure it works.

        Note that C: is the partition where you deployed the image

        • One happy chappy

          Thank you! I thought I was gonna have to start from scratch before finding this gem! And thanks to the ITBros for writing this article. 🙂

    • Ben

      I have the same BOOTMGR is missing error, and even when I check the “boot” checkbox it won’t add it in. is there some .ini file I need to include so that when I apply an image it automatically has the BOOTMGR present?

  • Jesse

    You’re spot on to wonder about DeployAnywhere. There has definitely been some product integration since Symantec’s acquisition of Altiris a few years back. DeployAnywhere was added to Altiris Deployment Solution with 6.9 SP1. Here’s some additional info:

  • Mike

    How do i get it to prompt for a Key at install. We don’t have a open key but want to use the image for our installations.

  • John

    Hmmmm, still having the strangest problem I did as you suggested and for some reason that created an image of just the boot files. so at this point I can load my win7 image and then load the boot files image and then everything works but for some reason I don’t seem to be able to get them both into one image.

  • Jay

    I am currently deploying 400 windows 7 VM’s using a Parent VM. I want all of them to have specific names. Currently in my sysprep file I have a * for the computer name which gives me different names for all of them which is good but these names are random. For my testing I need to have users created in the active directory which have the same name as the VM’s that are going to be deployed. I have created users “VDI-1” to “VDI-400” on the active directory. I want the VM’s to have the same naming convention. Currently they all have random names in no specific order. If I remove the computer name line from the answer file, it would prompt me for a computer name but I dont want to manually go through all the 400 VM’s to name them.

    • Dennis

      Have you found an answer? I have a PowerShell that works for me to pull the ServiceTag but can’t find where in the Unattend.xml to execute the ps1 file:

      #PowerShell for changing Computer name
      $info=gwmi win32_bios
      Set-variable -name prefix -value “MyPreFix-”
      $Computer=GetWmiObject Win32_ComputerSystem

    • Shaun

      Old question I know, You can use WDS to do that for you. It allows you to create a ‘formula’ for your PC names, that allows you to auto increment a number. I have mine as —

      It works an absolute treat and Im sure youll be happy with it.

      • Shaun

        Sorry my formatting got removed, I have [3 letter location]-[3 letter systemtype]-[3 digit auto incrememting number]

        As I said it works a treat.

    • aerilus

      you are most likely going to have to script it here is some talk and examples about automatically naming computers based on mac addresses

  • Kyle

    I loved this tutorial. Very easy to understand. We are now using Sysprep to deploy all of our new machines, and this page is definitely going in my “useful links” folder!!

    Great Job!!

  • Bill Swallow

    Hi; I posted a couple of messages on the previous iteration of this site back on Jan. 28 2011, never got any response. At the time, I had a question re: the way the Windows Systems Image Manager worked. Now I’m trying to build a usable Win7 image, and I keep running into a problem – when I wake my reference machine back up after pulling the image off it, I get the dreaded “Windows could not finish configuring the system” infinite loop.

    My machine is a Dell GX960, stock, but with 8 GB of RAM. O/S is Win7 Enterprise X64. I installed the O/S and immediately went into ‘audit mode’. I’ve been breaking the process down into chunks. I add a few items to my ‘baseline under construction’, then pull a Ghost Image of the machine (*without* sysprepping) as a safety net. Then I disjoin the machine from the domain, Sysprep it with my unattend.xml file, and capture an image to my WDS server. If the reference machine wakes up OK afterwards, I then clone that image to a second machine and wake it up. If it comes up sane, I then reload the checkpoint Ghost image and run down a few more items on my build checklist, lather, rinse, repeat.

    Up to Checkpoint 3, everything was going OK. Installing all my H/W drivers didn’t kill it. Joining the reference machine to the domain and logging in as a domain user for a few steps didn’t kill it. Installing my utilities suite didn’t kill it. So far so good. Then I installed my applications suite – Lotus Notes 8.5.1, MS Office 2007 Pro, PowerDVD 8 DX, Roxio Creator 10.3 DE, VPN Client, Service Desk Online (link to online help desk), Windows Live Messenger 2011, SunJava 6, MS SourceSafe 2005, MS Virtual PC 2007 64-bit, VLC 1.0.5. Set ‘RestrictAnonymous’ in the Registry to ‘2’. Pulled the checkpoint Ghost Image, disjoined from the domain, sysprepped, pulled a WDS Image – and the reference machine comes up with ‘Windows could not finish configuring this computer’.

    So, now I’ve reloaded by Checkpoint 3 Ghost image and am about to start the (painful) process of installing these apps One. At. A. Time. and sysprepping and testing after each one to see what’s breaking my image.

    I’m hoping someone here can save me some time and throw me a hint. Any thoughts?

    • NeedHelp

      We’re getting the same Windows 7 error message, “Windows could not finish configuring the system.” after we installed Checkpoint and created the ghost image. Please reply if anyone finds a resolution to fix Checkpoint for Windows 7 for ghost imaging.

    • NeedHelp

      We are having the same issue with Windows 7 64bit and Checkpoint VPN when trying to sysprep with ghost.

      Has anyone found resolution

      • Holly

        We had this problem and it was fixed by cleaning up extra user accounts from the registry. We had domain admin accounts listed there, and a test user account. HKLM> Software>Microsoft>WINNT>Current Version>Profile List. I deleted all but the local admin. Then sysprep the image and it works perfectly.

  • We had a similar issue at work… A work colleague of mine was trying to sysprep an image for a media department which required a lot of additional software that we normally don’t install. He was getting the same error and we finally narrowed it down to a single application. I don’t remember the name of the application, but it wasn’t any of the ones you mentioned above. I can confirm that MS Office 2007 Pro, SunJava 6, and VLC work fine. So maybe that helps narrow it down a little bit. We found that about 2% of applications just break the sysprep for some reason. Sometimes it can be fixed playing with the registry. But the solution that worked better for us was to simply deploy that application, by packaging it into an MSI with AdminStudio, and deploying it with SCCM. Hopefully that helps a little bit..

  • Eric

    Hi Brian, thank you very much for the tutorial.
    Could you please email me the xml file you created?
    cuz the one I created doesn’t seem to work 🙁

    • George

      I’m having a similar problem. I want to the prompted for JUST a computer name, not to create a new local admin account since I’ve enabled the local admin one but I still can’t get it to not require a new local admin account. I would love a copy of the xml file if possible. It would be greatly appreciated.

      • Joe P

        I’ve found that the way around the local account creation is to re-enter the admin account that alreadY exists in the build. Now I don’t get the prompt, I don’t activate Administrator, and I don’t get an extra local account.

        Here’s the excerpt from my xml:



        • Joe P

          Sorry, forgot that the tags would get ingested 😛

          Here it is again with plain text headings:
          LocalAccount wcm:action=”add”

          • rafael serbia

            I tried this step and no luck. My sysprep unatten file works fine but it always prompts for a new user. Any idea?

  • tal-t

    Brian, I installed SP1, then I imageX-ed my computer to create a new wim file. When I loaded my wim file in WSIM, now I have 2 of every component (6.1.7600.16385 and 6.1.7601.17514). I am try to create an answer file. Do I configure both components in their respective phase?

  • Marc DeSilva

    George, Eric,
    I don’t know if you got this answered. I had the same problem. I found this tutorial that works perfectly.

    • Eric Z.

      Thank you very much for the link!
      It’s very helpful!! 🙂

  • Pingback: Install WAIK supplement for Windows 7 SP1 - The IT Bros - We Know So You Don't Have To()

  • Sam


    Nice article first off. Came in very handy. I have one question though.
    With large scale deployments are you able to pull the serial from the computer and use that as the computer name?


    • Ralph

      I use a utility called wsname.exe which can pull the serial number for you. I have it embedded in my Win7 image and it works beautifully! Just add it as a batch file in your Scripts folder. You can find information on it here:

      By the way, I first came across this site a little over a year ago when I began looking at Windows 7 deployment initially and this has been the TOP RESOURCE of anything I have come across. (I just happened to take a visit today since I’m working on my SP1 build) Thanks a ton Brian, I’ve rolled out over 500 clients this past year thanks to this doc! Much appreciated!!!

  • Pieter

    Hi there!
    I’m a great fan of this website. I use this manual to sysprep all my machines and it worked great till now. I’m making a new image and install soms new software (software I didn’t install on the other images). After sysprepping the machine, I boot it again and the sysprep fails during the screen “Services …” I get a window with some text who says that the machine has to reboot to continue and so try again, but then again it fails.

    Is there a solution for this issue?


    • Bob O

      The exact error is:
      Windows could not finish configuring the system. To attempt to resume configuration, restart the computer.

      A pointless error. First time I got it on a machine, I was able to contact MS for a patch that solved the problem. I tried the patch on this pc and it says it does not qualify. This pc has been built following all the above instructions exactly. All softwares and patches have been installed. I’ve looked all over the place for a solution and this was my last hope that maybe I was doing something wrong.
      The patches I got were:

      The latter patch was the one that worked on my last build and I found the former a few days ago. Neither will install as they say the machine does not qualify for these patches.
      Any ideas?

      • Bob O

        Think I got the patch problem figured out. I started from scratch, again, but this time, I applied the patch before allowing windows to put in MS updates.
        I’ll let you know if this works.

      • Bob O

        Well, applied the patch first this time and didn’t let wiindows 7 sp1 installed, and got the same error.
        I’m all out of guesses as to what to do.

      • Bob O

        I got it. The new windows updates take care of the 8kb issue. However, my virus program has a registry protection against malware and was keeping sysprep from changing the registry.
        Here is how you can view your logs:
        The above link was referencing the 8kb limit, which is not an issue anymore, but shows you how to view the logs. When you get the error, you can start a command prompt, I believe shift+f10 which will start a command prompt for you. And, you can use notepad from within that prompt…just type if notepad and it will start….yes…I was surprised. You may see a pop up error when it starts, just click ok and proceed to open your log file.
        For my first try, I installed all Windows and Office updates and had not a single issue.
        Here is a link for the virus programs that cause problems:

        Yup, these guys are awesome, just wish the moderator or admin had seen this and pointed us to the above link since it was on their own site. LOL. Anyways, this discovery has ended 4 whole working days of misery and frustration.
        I haven’t installed my virus scanning software yet, but I am assuming at present that that is my issue. I will update again later when I install it, sysprep it and then try to deploy.
        Good luck

      • Bob O

        Last update:
        It is working perfectly fine now. It was my anti-virus program. Just had to turn the part off that keeps the registry from being written too, and then once you have your image and deploy it, all you have to do is turn it back on.

  • Devon

    I have a question in regards to how to get from step 14 to step 15. I was able create and capture my image using GimageX V2 via the WinPE 3.1 bootloader. This gives me a 4GB Windows7pro .wim file. A .wim file is not something I can boot a PC with. So I am not sure how you can get to step 15. How is this image loaded onto new PC’s? I would like to have a bootable ISO or USB with my new Sysprep’d custom image. Any idea’s?

  • Mike

    Sysprep needs the full path to the xml file or else I get:
    “Windows could not parse or process unattend answer file [C:\Windows\system32\sysprep\unattend.xml] for pass [specialize].”

    So in step #13, the command is not:
    sysprep /generalize /oobe /shutdown /unattend:unattend.xml
    The correct command is:
    sysprep /generalize /oobe /shutdown /unattend:C:\windows\system32\sysprep\unattend.xml

    • Dash

      The instructions telll you to use Explorer to go to that folder, then right click and choose, open a Command Prompt from this location. That would open a command window with a prompt of C:\windows\system32\sysprep, and then running the command as is indicated would work because the file would be local to your current path.

      In my case I don’t get the option to ‘open a command window from this location’ so I had to change the folder location manually myself first, or as you indicated specifically spell out the location of the files in use.

      • Brian Jackson

        Try holding down the SHIFT key and right click with your mouse in the blank space of the folder. Then you should get an option to open a Command Prompt window.

    • Stretch


      Thanks for the answer to this, I was running into the same parse problem. your reply helped me out big time !

      thanks again

    • Bryant

      Mike, Thanks that really help.I am getting prompted for a user name how can I get rid of that?

  • Justin

    Does anyone know of a way to be able to add a computer to domain with sysprep? XP sysprep, it would have computer name, and it would ask to join domain or workgroup on the same screen. Windows 7 sysprep is just asking for computer name and then it just logs in. I want to be able to put in my computer name, what domain and then put my credentials in.


  • Michael

    How can i get the install to prompt me for the product key. I have been messing around with trying to get the image to work.

  • Juan

    Hi ,

    we have a big problem with sysprep.
    we would like computer add to domain but cannot work with sysprep.
    it put directly workgroup when tthe sysprep finish.
    Need you help thx


  • Justin

    Juan – I just spent the last 4 days trying to figure Win7 Sysprep to allow to add computer to domain. You need to add UnattendJoin to your xml and put in all the information, but you have to use a custom script to ask for computer name first before adding to domain. The below link helped me a LOT, but I still had a few issues I ironed out. If you need help, my email is jlachowin at alcco dot com – good luck.


  • Phil

    Hi, I have tried using the install.wim and the proper version’s .CLG from an oem install disc that ships with our model of laptop. I have created an answer file with WSIM and saved it to a UFD as Autounattend.xml as mentioned in the WAIK.chm. However, despite trying all of the ports, when I boot the oem disc with the UFD inserted, it just comes up as normal, where the first questions is which language, followed by Language, Time/Currency, and Keyboard/Input method. Is it possible to create an unattended install using an oem disc or am I up the creek here?


  • Wajhi

    Thanks for posting I can run sysprep with an XML file I hav with no problem but we need to run a program for laptops customization and nee to kno how we can do that,

  • Patrick

    Brian, I used this site about 9 months ago to help me create images. It was an incredible resource for me and helped me in so many ways I can’t even begin to express. At the time, there was discussion about joining the machine to a domain. I messed around with the answer file but ended up just dealing with the fact that I had to rejoin my domain after the image… even though it said it was a member of my domain.
    9 months later I am curious if there has been discussion I have missed about how to set up the answer file correctly so it will join a domain. I appologize if this subject has been beat to death!

    This site is a HUGH resource for so many people. Thank you for your time and energy!

  • frame45

    OK “sysprep” and “building a custom install of Windows 7” are two completely different things. This tutorial is how to make a custom install of Windows 7 (aka “Windows System Image Manager”). If all you want to do is sysprep your win 7 (which is basically just the OOBE) all you need to do is run C:\WINDOWS\System32\sysprep\sysprep.exe

  • Chris

    Brian, is there any way to just tweek the image after its been built for customization? Like, if we had some changes going forward do we have to recreate the image from scratch or can we just make the necessary changes and then run the sysprep again?

  • David

    Quick question that will most definitely sound stupid:
    How do you deploy the finalised *.wim image to a group of computers?
    Using WinPE to clone computers one by one is too slow,
    and using MDT 2010 invalidates everything that I’ve done here to create an image.
    Is there a method like Norton Ghost, where I can boot “xx” amount of computers,
    put them in a “wait” mode, then on an image server start the cloning operation?

    • Robret

      You could always use WDS in Windows Server to help automate the Deploy and Capture steps. It uses WinPE, but puts it in an easy to use GUI. This site will answer any questions you have as well as provide several easy to follow tutorials. I’ve been using WDS for several years and have had no problems at all using it with Server 2003 and 2008.

    • Bob

      On Server 2008 R2, WDS has the capability to multicast.I have done successful multicasts with it. It’s very nice to be able to image handfuls of machines in one blast.

  • Dan

    Is there a log where you can see errors in the sysprep process. I noticed “Mike” above quoting an error, but where is that log file?

  • Rick

    What happens if you dont go into “audit mode” can you still un sysprep and answer file with no issues? I’ve deleted all user accounts but the admin and have that profile customized..

  • Richard Davis

    I have built and rebuilt the sysprep.xml over and over very carefully and methodically using the instructions on this page as well as other imput. But no matter what I use, I always get the same error: “Windows could not parse of process the unattended file [unattend.xml]. The specified file does not exist.
    Does anyone have any insight as to why I am getting this error?

    • Vaughan

      Richard, run the sysprep command (sysprep /generalize /oobe /shutdown /unattend:unattend.xml) with elevated priv cmd. had the same message until I ran with el priv.

    • Dan C

      You need to make sure that the XML file is in the correct place. Also, you should run the XML file from that location. The sysprep.exe utility is located in: C:\Windows\System32\sysprep
      Run sysprep from THAT location. This might fix the issue. Also make sure the XML file is in that location as well.

    • rantyracer

      there are a lot of causes for this mate.. did you want to attach your .xml file?

      so we could have a sight on it? cheers!

    • Sean Cotter

      There is a good chance that there are lingering profiles referenced in ProfilesList under WindowsNT/Profiles in regedit. This will cause what you are dealing with. Delete the profiles that don’t have a appropriate local account (delete the domain profiles minus the one you are logged in as). you can tell which is which because userusername will be in the details for each entry.

  • Daniel

    Will this work with Win 7 Pro and a MAK license?

  • Robert

    Try setting the CopyProfile to False, if it works with this setting you may have to go clean up the registry before you will be able to copy the profile.

  • Gary Wertman

    Well, I followed this but used my own xml file. Oddly enough after running sysprep /generalize /oobe /shutdown /unattend:unattend.xml it does it’s thing and shuts down. However when I turn it back on it goes through setup is etc… and then boots into audit mode and sysprep runs again…. Hmmm….

  • Christopher Denny

    Anyone can answer this. After the Sysprep /Generalize /oobe we can deploy to other clients and it runs what is in the unattended file. I need to run two different unattended files and require to reboot between them. Any suggestions?

  • user101

    Is this possible to do with HP Windows 7 OEM DVD media?

    I have allways had problem with the installation after I have syspreped and capture the image.

    “Windows cannot finish the installation…..”.

  • Roger

    I have created my xml file and for the most part it works well, but I find that my Microsoft-Windows-IE-InternetExplorer settings do not get applied to my default user profile (but does to the local admin that ran the sysprep command) as well as the 3 does not apply.

    Any thoughts

  • Clifton

    First of all I would like to thank you for the work you did on this site. I have one question that I can’t seem to figure out and it hasn’t been posted on this site. Is there any way I can include a batch file or a script that would allow me to unattend uninstall and reinstall application in this sysprep configuration? I am having a problem with the Dell Free Fall Protection driver getting corrupted and needing to be uninstall, than reinstall after sysprep completes. Any assistance would be apprecaited. Thanks

  • Steven Khieu

    Hi Brian,

    Would you happen to have an article on the process of automating the install of Office with windows on clean install. Or how to slipstream office into windows ?

    Win7x64 & Office 2010 x64

    • Dash

      If you install Office before you run sysprep it should then be on any computer you push the image onto.

  • ndog37

    I run this script on restoration of the image. The only advantage is that if windows happened to already be activated it wont run again. Also its in one script. It can do a few other ‘nice tings’ as well.


    @echo off

    set _username=A Badass Company Deal
    set _servername=SERVER

    set _win7MAK=77777-HVYXV-K3GY8-THWB2-WWWW
    set _2010MAK=PPPPP-6M6CP-G3446-J2QTB-BBBBB

    REM Use current working dir
    cd /d "%~dp0"

    echo Register MS Office to the user
    rem Scans through all 'valid' user profiles and sets to each registry

    rem OS specific profile paths
    set XP=Documents and Settings
    set Vista=Users

    rem XP exclude - All Users, Default User, LocalService, NetworkService
    rem Vista exclude - Public, Default

    for /f "tokens=*" %%g in ('dir /b %HOMEDRIVE%\ 2^>nul') do (
    if "%%g" == "%XP%" (set _profpath=%HOMEDRIVE%\%XP%)
    if "%%g" == "%Vista%" (set _profpath=%HOMEDRIVE%\%Vista%)

    rem Scan for UserProfile Folders (including hidden)
    for /f "tokens=*" %%g in ('dir /b/ad "%_profpath%" 2^>nul') do (
    set _userprofile=%%g
    if "%%g" neq "%USERNAME%" if exist "%_profpath%\%%g\NTUSER.DAT" (
    reg load HKU\ZZZ "%_profpath%\%%g\NTUSER.DAT" >nul
    reg add "HKU\ZZZ\Software\Microsoft\Office\Common\UserInfo" /v "Company" /t REG_SZ /d "%_username%" /f >nul
    reg add "HKU\ZZZ\Software\Microsoft\Office\Common\UserInfo" /v "CompanyName" /t REG_SZ /d "%_username%" /f >nul
    reg unload HKU\ZZZ >nul
    if "%%g" equ "%USERNAME%" (
    reg add "HKCU\Software\Microsoft\Office\Common\UserInfo" /v "Company" /t REG_SZ /d "%_username%" /f >nul
    reg add "HKCU\Software\Microsoft\Office\Common\UserInfo" /v "CompanyName" /t REG_SZ /d "%_username%" /f >nul

    if not defined _win7MAK if not defined _2010MAK goto :nokey

    echo Checking for internet connectivity needed to activate
    echo This screen will not progress until internet is established

    PING -n 3|find "TTL" >NUL
    echo Internet Detected

    echo Change the time
    net time \\%_servername% /set /y

    echo Prompt to activate Windows 7 if needed
    if exist "%windir%\system32\slmgr.vbs" FOR /F "tokens=5" %%a in ('cscript "%windir%\system32\slmgr.vbs" -xpr') do (set _act=%%a)
    rem if "%_act%" neq "activated." if not defined _win7MAK slui 1
    if "%_act%" neq "activated." if defined _win7MAK (
    cscript "%windir%\system32\slmgr.vbs" -ipk %_win7MAK%
    cscript "%windir%\system32\slmgr.vbs" -ato

    echo Prompt to activate Office 2010 if needed
    if exist "%PROGRAMFILES%\Microsoft Office\Office14\WINWORD.exe" set _offver=%PROGRAMFILES%
    if exist "%PROGRAMFILES% (x86)\Microsoft Office\Office14\WINWORD.exe" set _offver=%PROGRAMFILES% (x86)

    if defined _offver if defined _2010MAK (FOR /F "tokens=3* delims=: " %%a in ('cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /dstatus') do (
    if "%%a" == "---OOB_GRACE---" (cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /inpkey:%_2010MAK%
    cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /act)
    if "%%a" == "---OOT_GRACE---" (cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /inpkey:%_2010MAK%
    cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /act)
    if "%%a" == "---NOTIFICATIONS---" (cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /inpkey:%_2010MAK%
    cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /act)

    rem if defined _offver if not defined _2010MAK (FOR /F "tokens=3* delims=: " %%a in ('cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /dstatus') do (
    rem if "%%a" == "---OOB_GRACE---" "%_offver%\Microsoft Office\Office14\WINWORD.exe"
    rem if "%%a" == "---OOT_GRACE---" "%_offver%\Microsoft Office\Office14\WINWORD.exe"
    rem if "%%a" == "---NOTIFICATIONS---" "%_offver%\Microsoft Office\Office14\WINWORD.exe"
    rem ))


    echo clear autologin property
    SET _WINLOGON="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
    REG ADD %_WINLOGON% /V AutoRestartShell /t REG_DWORD /d 0 /f
    REG DELETE %_WINLOGON% /V DefaultUserName /f
    REG DELETE %_WINLOGON% /V DefaultPassword /f
    REG ADD %_WINLOGON% /V ForceAutoLogon /d 0 /f
    REG ADD %_WINLOGON% /V AutoAdminLogon /d 0 /f

    echo Clear all used variables
    for /f "usebackq tokens=1* delims=_=" %%a in (`set _`) do set _%%a=

    echo Finally Delete myself and folder (should be temp!!)

    echo rd /s/q "%~dp0">"%temp%\erase.cmd"

    echo echo option explicit ^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"

    echo echo Set ws = WScript.CreateObject("WScript.Shell") ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo Dim ws, t, p1, p2, p3, p4, n, cn ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo Dim itemtype ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo p1 = "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\" ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo p2 = "HKLM\SYSTEM\CurrentControlSet001\Control\ComputerName\ComputerName\ComputerName" ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo p3 = "HKLM\SYSTEM\ControlSet\Services\Tcpip\Parameters\NV Hostname" ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo p4 = "HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters\NV Hostname" ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo n = ws.RegRead(p1 ^^^& "ComputerName") ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo t = "Change PC Name" ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo cn = InputBox("Type new PC Name and click OK", t, n) ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo If cn ^^^ "" Then ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo ws.RegWrite p1 ^^^& "ComputerName", cn ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo ws.RegWrite p2, cn ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo ws.RegWrite p3, cn ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo ws.RegWrite p4, cn ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo End If ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"

    echo echo if msgbox("Do you want to shut down this computer?", 4, "System Shutdown") = 6 then ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo dim osObj, osColl ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo const nLogOff=0 ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo const nReboot=2 ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo const nForceLogOff=4 ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo const nForceReboot=6 ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo const nPowerDown=8 ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo const nForcePowerDown=12 ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo Set osColl = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem") ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo For Each osObj in osColl ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo osObj.Win32Shutdown(nForcePowerDown) ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo Next ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo echo end if ^>^>%%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"
    echo %%temp%%\shutdownprompt.vbs>>"%temp%\erase.cmd"


  • Hank

    This was a great tutorial. However, I could not get get our MAK key to activate unless I included the key under section 4 (Specialize)/amd64_Microsoft-Windows-Shell-Setup_neutral/Settings/ProductKey. Once I added the MAK to this section, the product activation completed without issue.

  • Thomas

    This is a great tutorial, however, following these instructions has run me into an issue. For some reason, the SID is identical on all of the machines I’ve imaged in this way. I’m new to imaging and just started work at a small company; my network colleague is having a big issue with this. Any advice or know what I could have messed up to cause this to happen?

  • Rick

    I finally got it set up to where it will sysprep and join the domain without asking for credentials. The only problem I have now is that I am trying to figure out how to get sysprep to strip the product key and prompt me for one like it used to in WXPP. The reseal feature of the old sysprep did this. I have not seen where to do this in this tutorial or the other one at

    • Thomas

      I assume what to be prompted for a Win7 key every install, just do not follow this step from the tutorial above:

      CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX (windows 7 license key)
      Order 1
      RequiresUserInput: false
      CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ato
      Order 2
      RequiresUserInput: false


      I did not follow this step, as I am imaging many different machines for deployment in a small enterprise environment and we do not have a volume license. Works like a charm.

      • rick

        , that is what I thought after taking a couple of days off and rethinking this but it did not work. I am going to try this:

        FirstLogonCommandsCommandLine: cscript //b c:windowssystem32slmgr.vbs /upk

        and leave out the Order 2 line altogether. I’ll post up if this worked.

  • Joe

    I’ve imaged a PC by installing the OS from a manufacturer disc, installing all the necessary drivers and programs, then running sysprep from C:\windows\system32 and checking OOBE. I’ve never gone through audit mode or created an answer file.
    What’s the difference between this procedure in this article and the one I just mentioned?

  • James

    I have followed all instructions and also copied ghost64.exe to my USB. I boot from the USB, and at the command prompt, I run ghost. It works great on my Dell PCs and laptops. I have a new Lenovo Thinkpad W520. My boot USB works fine on all other machines except for a Lenovo W520 laptop with this nic:

    Ghost multicasting fails to pick up an ip address due to no Intel 82579LM driver in the wim.boot file.
    After I unzip the Win32 nic drivers from Intel, I want this file: PRO1000\Win32\NDIS62\e1c6232.inf

    How do I add the intel nic driver to the wim.boot file?

  • Funkyman

    Where do you get the slmgr.vbs script to automatically activiate windows on first boot ?

  • rantyracer

    @theitbros:disqus Hi Brian – This tutorial really helps me alot! Windows 7 is a bit pain in the ass when it comes to syspreping it! I just want to provide a couple of tips to everyone out here…

    1. It will be very helpful to include the “Microsoft Windows PnpSysprep component into our answer file into “Generalise Pass”. This will let retain all the new drivers that you have added, incase you are building different PC brand and model as well. PLEASE SEE IMAGE!

    2. And last thing is the “skiprearm” this will be very crucial when we want to deploy our customise image into a production environment or multiple PC.

    a. Sysprep the customised image with the value of ” 1 ”

    b. Use the same image, then perform another sysprep but… this time we need to replace the value into ” 0 “.

    explanation: When deploying image with skiprearm value set to ” 1 “, computers dont generate unique Computer Machine ID ( CMID ) which causes issue into the KMS server. This is a bit of explanation, happy to explain further if needed.


  • Calcaterra

    Hi everyone, I have been creating company images for a while and has been a wonderful experience as well as fun. The only issue that I have been having with the process is the time zone setting will not take and ive defined it as “Mountain Standard Time”. I have tried several different times but still keeps popping back up for an answer to which time zone im in. Any help would be greatful.

  • Gene

    Great tutorial man. Thanks for posting this and making my windows 7 deployment a success. I was able to build an image and push this out to 30 netbooks in a few days. The teacher piloting windows 7 and office 2010 loves me since I was able to get his project started early.


  • Happy

    How to add OOBE – UserAccounts – Without PASSWORD . ?

  • Luis

    Hi, I’d like to thank you all so much for the walk through as well as the many very helpful comments here. This is the first Image I’ve ever had to build. I have used the guide and it has taken me much further than anything else. However, at the moment I am having an issue. At the company I work for, we like to rename the local admin account for security reasons. At first when I was creating the xml answer file I was getting the image creating an extra account by that name and placing it in the local administrator’s group. so I went back and substituted the name of the account wherever the administrator account was mentioned in the answer file. Now, when I apply the image, after going through the “Name the PC” part, I get to the log in screen and get a message telling me “The user name or password is incorrect” and even if I type it in manually, it gives me the same error message.

    Here is the xml file I have created … sorry for the large paste



    net user Mars /active:yes



    Eastern Standard Time





    cscript //b c:\windows\system32\slmgr.vbs /ipk *****-*****-*****-*****-*****

    cscript //b c:\windows\system32\slmgr.vbs /ato




    Local Administrator

    My Company
    My Company

    Any help or suggestions would be GREATLY appreciated!


    • Luis

      Strange, it didn’t paste with the tags at all, Do I need to do something special to paste with the tags so it’s easier to read?

      • Just add < code > + < / code> without the spaces to your lines of code. I am actually going to be editing the CSS so that code is a different color. Also, we are about to launch a FORUM which I think will help for this Sysprep stuff.

  • Luis

    Here is the code again … 🙂



    net user Mars /active:yes



    Eastern Standard Time





    cscript //b c:\windows\system32\slmgr.vbs /ipk *****-*****-*****-*****-*****

    cscript //b c:\windows\system32\slmgr.vbs /ato




    Local Administrator

    My Company
    My Company

    • Luis

      Please delete that, I feel like a spammer now

      I’ll try again …



      net user Mars /active:yes



      Eastern Standard Time





      cscript //b c:\windows\system32\slmgr.vbs /ipk *****-*****-*****-*****-*****

      cscript //b c:\windows\system32\slmgr.vbs /ato




      Local Administrator

      My Company
      My Company

  • Luis

    ok, I give up 🙁

    • Luis

      Maybe I could mail the xml file?

  • Boris

    thank you for the helpful instructinos. I am actually using them to build unnattend.xml for WDE deployment. I spent a couple of 12-hour days and got all my issues solved except 1 – I am unable to auto-active windows, using firstlogon command in OOBE. I can see in setupact in Panther directory that my commands appear to be added to runonce, but windows remains unactivated. If i run the slmgr.vbs /ato after I log in – it activates with no issues. This prompted me to question – whether, or not any of my firstlogon commands are executed – I added a couple of test ones and see that none of them appear to be running. I searched high and low and confrimed that I activate admin account earlier in specialize phase, it is active, it is a member of administrators e.t.c I am out of ideas. Do you have any clues?

  • David Henderson

    When creating/testing an image we use these steps
    1. Have two computers of the exact same model, I will call them Machine A and Machine B
    2. Install Windows 7 Professional on Machine A
    3. Boot into Audit mode
    4. Install all software, drivers, and tweak settings
    5. Run sysprep /generalize using an unattend.xml file where SkipRearm is set to 1
    6. Reboot and use imaging software (Ghost, Deploystudio, etc.) to grab an image. Once an image is grabbed from Machine A, shut it down
    7. Apply this image to Machine B and test to make sure everything works as planned
    8. If changes need to be made, boot up Machine A, enter Audit mode again, tweak image and repeat steps 5-8 until the image is perfect

    Once we have a perfect image, we want to deploy it to all the machines of the same model, make sure they activate, and across time update this image as needed. We have come up with two methods and need some guidance on which one to use.

    METHOD 1
    – Run Sysprep /generalize with SkipRearm set to 1 and grab an image
    – Run Sysprep /generalize with SkipRearm set to 0 and grab an image
    – The two images would obviously be named such that you can distinguish between them.
    – Use the image with SkipRearm set to 0 on all of the machines of the same model. They will activate fine
    – When it comes time to update this image, apply the one with SkipRearm set to 1, update the image, and then grab two new copies

    METHOD 2
    – Run Sysprep /generalize with SkipRearm set to 1 and grab an image
    – Apply this image to all the machines of the same model
    – On each of these machines run this at an elevated command prompt:
    cscript c:\windows\system32\slmgr.vbs –rearm
    This resets the CMID and allows the machine to activate

    • This is a great summary David! Thank you for sharing.

  • Mike

    Under Step 11 it says that the Administrator profile will be deleted upon running Sysprep – this is not true. I just ran Sysprep and the administrator account was alive and well. I then ran Sysprep with the /generalize option and it also did not delete the administrator account – did it do that in your testing?


    • Mike

      Now, one thing I should mention is that I did have the unattend.xml file with the copyprofile setting sitting in the root on my C drive, but would sysprep pick that up even if I didn’t explicitly specify it in the command-line parameters? Also, I would assume that setting only tells sysprep/windows setup to copy the profile, but doesn’t specify what to with it afterwards.

  • Mike

    Under Step 6 you say the following:

    “Set 1 for SkipRearm to allow up to 8 rearms”

    I was curious where did you got the number 8 from? I saw a post on technet where someone referenced the number 8 and the moderator came back and said that you just need to use the skiprearm setting for repeated syspreps – no mention of any limit…

  • Alex Smith

    Hi all,

    Thanks for this great instructional guide! It has saved us a great amount of time in our last deployments. However, I’m currently experiencing an issue with my Windows 7 64-bit image. After I capture the image and try to push it out onto a client computer through WDS, I keep getting a ‘Corrupt Image’ error. I can push out the base windows installation just fine, I only have the issue when I push out the pre-configured .WIM file. What could be causing this? Is there any more in depth documentation on GimageX? Any insight would be helpful. Thank you for everything!

    • sxewhodey

      I am seeign errors with corrupt images as well wen trying to add them in Deployment services. I think it looks for the description or label to stay the default WIM1 and that is what it likes. May want to try to re-label it. Thats what I am leaning to as an option to try next.

  • Babs

    I currently use a vbs script to map all my task bar icons (which I recommend to everyone). Brian and I discovered that if you add the following code to the task bar script you can avoid step #12. I’m all about saving steps! 😀

    dim filesys
    Set filesys = CreateObject(“Scripting.FileSystemObject”)
    filesys.CreateTextFile “c:windowssystem32sysprepunattend.xml”, True
    If filesys.FileExists(“c:windowssystem32sysprepunattend.xml”) Then
    filesys.DeleteFile “c:windowssystem32sysprepunattend.xml”

    Set filesys = CreateObject(“Scripting.FileSystemObject”)
    filesys.CreateTextFile “c:windowspantherunattend.xml”, True
    If filesys.FileExists(“c:windowspantherunattend.xml”) Then
    filesys.DeleteFile “c:windowspantherunattend.xml”
    End If

  • ChrisTxHouston


    Anyone know the answer to “Long” question?

    am using sysprep within the Altiris Deployement to capture and deploy the Windows* 7 and Vista* using the “unattend.xml” files to different laptops like HP, Lenovo, and Dell….
    A question is how to inject additional drivers for the above brands?


  • Jonathan

    Thank you very much for this guide.

    I wanted to point out a couple of things.

    1) You may wish to apply this hot-fix when building a master image. This was happening for me after applying Live Essentials 2011 to the build but it can happen in other situations.

    Fix for error: “Windows could not finish configuring the system. To attempt to resume configuration, restart the computer.”

    Cause: This issue occurs if the original operating system contains a registry key that is larger than 8 kilobytes (KB).


    2. In reply to someone who asked about retaining drivers. You can add PersistAllDeviceInstalls = true to 3 generalize – x86_Microsoft_Windows-PnpSysprep_neutral

  • sxewhodey

    Uggghh, one thing I cant seem to get right…..Start-UP. I do my default install which creates two partitions, then I capture only the D:Drive and select the option to make it bootable. After the image is captured and selecting the boot option, I go back and get rid of the system boot partition so I can make it one drive, but it never starts up 🙁
    I always have to re-insert the Windows enterprise disc, go through 2 repairs, start the system back up, and recapture the image.
    I have to be missing a step or overlooking something.

    • sxewhodey

      Looked around the site a bit more and I found it 🙂 Sorry

  • Khat

    Why are using WAIK, WinPE and the rest pasted here > “WAIK RTM : KB3AIK_EN.iso Version 3.0 (Read our Tutorial).
    – Supplement for WAIK SP1 : waik_supplement_en-us.iso (Read our Tutorial).
    – Windows Vista or Windows 7 Machine to build the XML file on
    – ISO or DVD of Windows 7 Installation (x32 or x64)
    – WinPE Boot Environment : theITBros WinPE 3.1 BootLoader”?

  • Sharon

    I’ve haven’t used sys prep in sometime, this tutorial is a great refresher, it’s all come flooding back. Has anyone used this on VMWare virtual desktop installations? Thx!

    • @Sharon: I use VMware workstation all the time at work, but I have never used it to make sysprep images… It would be interesting if you could somehow build the image on a VMware/Virtual PC and then convert the .VMX/.VHD file to a WIM.

    • Yuri Olinares

      I have built my companies Win7 image on a virtual machine (works only .VHD virtual machines) and it works great, I had to do a couple of things to make it work perfectly, but the end result is image that runs on a virtual machine meaning no extra equipment needed when you want to update the image. Only downside is that it adds 30 to 60 minutes when creating the image.

      I will create the image on the virtual machine, verify it works (make a copy of the virtual hdd and then boot it up again to make sure there are no issues with the image) and then copy the .VHD file to my desktop. You can then go into disc management on windows 7 and go Action -> Attach VHD.
      After the VHD is mounted figure out what drive letter the data is on and use imagex to capture this drive. This is the part that can take some time. My laptop will take 60 to 90 minutes to capture the vhd and my desktop will take 10 minutes. You can then take the .wim file imagex generates and deploy it till you’re sick of WD or you need to update it…

  • Caleb

    I have a quick question… I’ve been having trouble creating a generic image I have 7 x64 Enterprise.
    I need to create a custom profile ( so i’m using copy profile ) But I want to input the User-name and computer name on each installation. I’ve gotten to the point where I can do that but it always has an administrator account visible as well. I don’t want that to be visible. Just new profile that I create (which has custom properties in it (ie files on the desktop etc.)

  • Joe

    Brian: A nice summary that I’ve been using this past year…thanks! One thing that I’ve noticed is that installing apps as Administrator in Audit mode increases the size of the profile to be used later as the default user template…maybe you’ve put this in your summary but I do a “pre-audit” step using the temp user (that Win7 asks for at finish of OS) to install as much of the apps as I can. Then I go into Audit mode in order to tweak Browser settings, etc., a minimal profile size, then I run sysprep. So far this works to keep the profile size down which helps with minimizing boot-logon time.

  • Alex ‘Freedom’ Haines

    Following on and enhancing what Babs posted above, you may want to consider this being added to the end of the SetTaskbar.vbs script instead:

    'Delete the Unattend File

    Sub DeleteUnattend()
    Dim filesys
    Set filesys = CreateObject("Scripting.FileSystemObject")
    filesys.CreateTextFile "c:\windows\system32\sysprep\unattend.xml", True
    If filesys.FileExists("c:\windows\system32\sysprep\unattend.xml") Then
    filesys.DeleteFile "c:\windows\system32\sysprep\unattend.xml"
    End If
    Set filesys = CreateObject("Scripting.FileSystemObject")
    filesys.CreateTextFile "c:\windows\panther\unattend.xml", True
    If filesys.FileExists("c:\windows\panther\unattend.xml") Then
    filesys.DeleteFile "c:\windows\panther\unattend.xml"
    End If
    End Sub

    The above code is more correctly indented, has the missing End If included and has the correct Double quote marks wrapping the file paths.

  • Justin Time

    Am I correct in saying it appears the steps outlined suggest you need to have an exisiting windows operating system in order for this to work? I get the impression, you need to overwrite your current windows in order to create additional folders like the sysprep folder and a few others because they either do not work or you have to create them yourself. In that case, is it fair to say, using my uninstall.xml script is useless when no operating system exists because I need to have the sysprepfolder first before doing the inital steps outlined earlier? I am only using a custom installation because I want to redirect the user accounts to another parition rather than the one set by default in the system drive c:

  • Antoine


    I have completed all the steps listed here. However, when I attempt to load Win PE from the USB i get the following: “Remove Disks or other media. Press any key to restart.”

    Any help is greatly appreciated.


  • morry davis

    I’m close to having what I want except for 2 issues. after I apply the image and restart the cloned machine it comes up with the sysprep gui started and I have to click OK it then reboots and starts the preparing for first time use.
    Also the local account I use to setup all the preferences for the reference machine is still there on the welcome screen as an option to login as when I logout of the new user I create on this new machine, it still has the password for that user because I use it to login but it warns me there is no profile for that user. What am I missing?

  • Francis Brooks

    sorry for the duplicates ….So I keep getting a Windows could not parse or process the unattended answer file for pass specialize. Error was processing settings for component Microsoft-Windows-Deployment.
    Here is the xml file


    net user administrator /active:yes


    Eastern Standard Time





    cscript //b c:\windows\system32\slmgr.vbs /ato

    cscript //b c:\windows\system32\slmgr.vbs /ipk 2YGD3-9V8GT-B83PP-KBM3F-BX8H3




    Local Administrator


    • Shane Hale

      Me too …I wonder it the 8kb registry thing or what ?

  • mrm3th
  • Joe

    Hello Brian, I really need your assistance. I have been following your site and the input from the users and you have done an awesome job assisting and solving lots of our problems. My question is that what I want to do is get a reference computer, install windows 7 enterprise 64bit, install all necessary apps, recent device drivers, and settings such as enabling local administrator, we have MAK licensing so all computers use this same key. I want to use WAIK to create the sysprep so that all pcs get a unique SID. All I want for WAIK to do is assign unique SID, use same win 7 product key without prompting for it, to leave the current apps and device drivers and settings alone, bypass all welcome screen prompts such as eula, time zone, etc and only for it to prompt for computer name first and if possible to add it to our school district domain. And then for it to do straight to ctrl+alt+delete screen already added to domain. The reason I want to do this is that we use Ghost and Clonezilla to capture and deploy images either via usb external drives and via a laptop/switch(1gig) as a local network to deploy to labs. Can you assist me in how I can do this via WAIK? Currently, I install everything on reference computer, not on domain, defrag disk, capture with Ghost, and use ghostwalk to change SID, then I add to domain once I’m on desktop environment.

  • Joe

    Also, I forgot to mention that with the current ghost method of capture and deployment of imaging, after the pc is imaged and we log on into the windows 7 desktop, I have to right click on my computer and then reactivate windows but I don’t need to re-key in the product key, I just need to have the computer connected to internet and just click to activate via online. Then we add pc to domain. Thats it.

    • mark

      why not setup a kms server it’s not that bad?

  • londo342

    How do you stop the Activation grace period counting down? Is it something to do with rearm?

  • Andy

    Thanks for your info. I used this a lot this summer to set up a few images for my school district. I have several labs where users are always logging into a computer for the first time. The user profile creation takes about three minutes. The next time a user logs into the same machine it takes a few seconds. Is there anything I could change in the steps above that might speed user profile creation up? Is there anything else I could look into to?

  • JP

    Hello Brian,

    Thank you for sharing this! Followed your instructions and was successful with capturing and applying the image but I still need to prompt for Win7 Product Key every install. I tried following Thomas’s recommendation to remove the following steps in my UNATTEND.XML file and was NOT successful.
    CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX (windows 7 license key)
    Order 1
    RequiresUserInput: false
    CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ato
    Order 2
    RequiresUserInput: false

    Is there anything I miss?


  • Michael

    Is there a way to have window 7 answer file prompt you for Register Organization and Owner input. Also to prompt you for Date, Time, Timezone on boot up.

  • Michael

    How do you set the answer file to prompt to enter Registered Organization and Owner. Also to prompt to enter Date, time and timezone on first boot-up. Can anyone help?

  • Champ

    UnattendJoin fails to join domain. DHCP server shows the lease “”. AD has new Computer object but object has generic name “WIN-S4L19U65CEG”.
    UnattendJoin added to specialize pass. Help?

  • cthao

    How do I perfrom windows update in audit mode? it seems to be disabled in audit mode.

    Preferably, I would like to have the latest windows and office security on my reference image and have a default profile configured before I ghost it.

  • JohnA

    Hi, I’m finally entering the 21st century and deploying Windows 7. I have a question, is it possible to sysprep a machine AFTER I have installed all my apps? I didn’t realize I would have to start from scratch with a clean install. I’ve got my master machine all configured and I hate to have to start over.

  • Anders Jensen

    How should I diskpart, apply my image from WIN PE. Could I use this example taken from technet or ? :

    select disk 0
    create partition primary size=300
    select partition 1
    format fs=ntfs label=”System”
    assign letter=S
    create partition primary
    select partition 2
    format fs=ntfs label=”Windows”
    assign letter=C

    part 2 -> imagex.exe /apply C:\myimage.wim 1 C:

    Part 3 -> C:\windows\system32\bcdboot C:\windows

    Part 4 -> Reboot

  • Tom Y

    My question is:
    Do I have to include the sysprep in the unattend file if I sysprepped prior to capture? Every discussion board I have run across includes sysprep.

  • Robert Martel

    Something I am not at all clear on after reading about windows 7, sysprep, and deployment (other than it is far more complex than XP – I’m pretty clear on that now.)

    If I have a machine configured the way I want it and activated, is there a way to use it as my basis for an image? The machine was set-up and configured as a plain stand-alone PC – I did not (know to) install the applications and customize the machine in ‘audit’ mode. Can I salvage my work so far, or need I start over with a fresh install of Windows 7 putting the machine in audit mode prior to local customization?

  • Ron

    THANK YOU, THANK YOU, THANK YOU…… This guide (and comments) saved my department tons of time in configuring a bulk of new laptops.

  • mark

    tried the machine name thing on windows 7 (all versions) and windows 2008 r2 all versions and it doesn’t work.

    Tried with the comptuername computername and without and still no prompt for name

  • Mike

    We have a Windows 7 enterprise 32 bit installation that we are prepping without using the Windows Image Manager or audit mode. We are making changes while logged into the local administrator account currently. We’ve installed MS Office 2007, along with some other applications as well as Windows Updates. We are also making registry changes and changing local GPO computer settings, as well as setting custom Internet Explorer options. Does the audit mode allow for multiple reboots to install various applications and Windows 7 Service Packs and updates?

    We would like to use Ghost to create the final image that will be sent out to multiple computers before deploying the computers into the field.


  • IT Genre

    Nice tutorial … I found this article when I was doing research on sysprep as we are planning on sysprepping all machines before imaging them. This way we can easily deploy them. Will follow through this tutorial when we actually start sysprepping machines.


  • Rich F

    I still have a problem auto-activating Windows 7. I’ve set SkipAutoActivation to false. I’ve tried SkipRearm to 0 and also to 1. I’ve added the Windows key in Product Key and also in the cscript. I can sysprep this machine over and over and it boots up with Windows activated. (All of my software is preloaded as a full image, so I don’t use provisioning). Once I sysprep, I use syprep /generalize /oobe /shutdown /unattend:unanntend.xml. Once I create an image with ImageWV2, and deploy that image, the 2nd machine is not activated. When I go to activate it, I go to Properties of My Computer, click on activate…it doesn’t ask for a key but activates fine. I need each deployed machine to auto-activate during sysprep. I know sysprep is working because I purposely mistyped the Windows key and sysprep failed on that step.
    Any other suggestions?

  • Joe Bova

    First of all, this Windows 7 guide is the best I have found on the net to date! It cuts to the chase with a working example, touche’.

    I do have a question. I have decided to rebuild my Win7 image from the ground up using SP1 installation media. So I created a new sysprep file (autounattend.xml) from the new media (and associated catalog file) and manually created all the entries that existed in my original sysprep file for Win7 RTM. No Joy. The CD media boots fine and wants to do a fully attended windows installation from scratch, ignoring my autounattend.xml file that is in the root of a USB key. If I take the old xml from the RTM build, replace the version numbers with those from SP1, file does get read, tries to start the unattended install, but errors out with the “Windows Setup encountered an internal error while loading or searching for an unattend answer file”.

    Before I loose the last three hairs on my head searching line by line for a potential fix, has anyone encountered this before and have some ideas as to what else has changed. I did do a quick compare of of the Autounattend.xml files but the order that the entries are written are not identical so nothing specific stands out save the version numbers. Of course I been looking at this so long that it has become a blur…


  • Joe

    Just checking to see if my question was answered Aug 3, 2011. Thanks.

    • Paul

      I can help you Joe. Your specs sound exactly like mine. And I managed to get this working.
      Shoot me an email and we can chat.

  • Danu

    Is there a way to directly edit a file in the wim image ? For example the slmgr.vbs script you used ?
    If we are using KMS key for activation this slmgr script is still useful ?

  • Michal

    ok, so sysprep is in C:\windows\system32\sysprep\sysprep.exe

    Helpfully, Windows search would not find it, you have to know it’s there.

    Helpfully, this guide does not mention that, either.

    This leaves the minor problem that the SIM form AIK is unable to create answer files.

  • Chris

    Got a question for everybody…

    I work at a high school. I do not have the ability to use Group Policy management and our staff at the district is so understaffed it is a pain to get them to help me out with anything… ugh.

    I have successfully gotten my sysprep to join my machines to the domain. I want to take this one step further for a lab I have to re-image.

    I want the computer to auto login once and run a script that will add a couple AD users groups to the local debuggers group. I am not great with scripting and need some help.

    Any body want to help me out?


  • Bill

    I must admit I haven’t done any imaging in about 10 years and the last time i did was with win2000 and ghost/nero and that was just following somebody else’s instructions. Now with windows 7 I am doing this by the seat of my pants and this blog has been great to follow and I have created a few images (with some success) but I do have a couple of questions. 1. There is no line to delete for computer name. I look at the xml file and there is no line to delete. Is it because I have a newer version of waik and by not putting in a computer name it automatically deletes the line. 2. Like everybody else I have domain problems so this will be something I will be watching closely. Also, if you don’t delete the time zone in the oobe (and leave it blank), it overrides the specialize section where you put the timezone in. I saw somebody else ran into this and I did as well. Kept reverting back to the pacific standard time. I just put it in the oobe section as well so it’s in both sections. One other factor that I ran into was that one of the programs I had for some reason created a temp file on the temp admin folder and when I ran sysprep with the oobe and rebooted, the program kept looking for the .msi file (which was no longer there). My quick fix was just to install this when I logged in the domain as a regular user with admin rights. Any ideas on this. Thanks again for a great instruction guide.

  • Dan

    This has helped a lot but the downside is every time apply the captured image to a new machine, i get the message saying bootmgr is missing.

    After a little bit of playing around i can recover from this by typing C:\windows\system32\bcdboot C:\windows /s C: in the command prompt of the winpe session but is there any way around this in sysprep?


  • Priit

    Thanks for this guide.
    I skipped step 9-11 (audit mode).
    I have Dell optiplex 390 with new preinstalled win7 pro.
    I installed programs (office2010, win7 updates etc) and modifaid default profile.
    Then did sysprep. (i entered Dell win7 factory key into answer file)
    I have 25 computers to clone.

  • John

    So, I follow and understand how the audit mode and copyprofile works with sysprep, but I’m not using MS deployment steps. I’m capturing and applying the image with Ghost. I’m also installing the applications from a network location which requires me to logon as a network account to access these files. Is there an order or steps that I should go through to still have the profile copy work correctly? A side question to that – does changes I make in the local security policy get modified when I run sysprep? or just the admin being enable by default?

  • Mike

    Have used your instruction set to successfully image many PCs. for those who want to have the image automatically join a domain, use WDS – you can put the key in, set up a naming scheme for your PCs and set it to join the domain.

    I am having an issue with my latest deploymet – or at least one PC on it – I have successfully imaged maybe 50 units but I have one – ONE! – that considtantly fails with the message, “Windows could not parse or process unattend answer file [C:\Windows\Panther\unattend.xml] for pass [specialize]. The answer file is invalid.” I am not feeling the love from that PC and it may end up doing a bounce test from the 35th floor.

    Anybody have any ideas what I may be missing?

  • Tim

    Why does your xml add a local account named administrator when the administrator account already exists?

    Also, I want to rename the admin account. Other google searches talk about using a wmic command in the setupcomplete.cmd and im wondering if you’ve had any experience with that. The articles i’ve seen also seem to do the same thing. They run a wmic command to rename the admin account to something else, but in their XML file, they have an entry in their UserAccounts section that creates an account with that same name. Isn’t one of those commands going to fail depending on when they run? If the LocalAccounts section creates an account called “YourAdminName”, but then later a wmic command runs to rename the admin account to “YourAdminName”

    Won’t that fail? and vice versa in the opposite order.

    I used this guide to make my first Win7 Pro sysprep years ago and it worked great. The only issue I never solved was that instead of renaming the admin account, It kept the admin account disabled and the local accounts section merely created a new account in the admin group. Problem was, that 2nd account is set to have the password expire, so we had to change the password eventually if we used it.
    So now I’m updating my sysprep for Win7 Enterprise SP1 and I’m running into issues. I want only one local administrator account (the builtin one and I want to rename it)

    • darkflux

      it doesn’t “add a new account” as much as it just activates the existing account.

      if you want to rename the admin account, you would do that on the source drive BEFORE running sysprep, then use that username in place of the “Administrator” in the above steps. sysprep shouldn’t change usernames, just re-setup Windows.

      it’s really easy to rename it:

  • Paul Barrette

    Does anyone know how to perform Step #9 on a fresh Windows Server 2008 R2 installation? I want to create and sysprep Server 2008 R2 images to use as hosts in our NComputing deployment, but I’m not sure how to get Server 2008 R2 right into Audit mode like I can with Windows 7.

    What is the best/proper way to approach this when creating Server 2008 R2 images?


  • Tim

    nevermind, after much google searching and trial and error I solved my problem. If you don’t put a user in the “LocalAccounts” section, Windows will prompt you to create a user in the OOBE. But the problem is that I don’t want to create any extra accounts, I simply want to re-name Administrator. So you put the admin account in LocalAccounts even though the account is already there, which satisfies the oobe so it doesn’t prompt you to create a user, then I added the wmic command to rename my admin account in the “SetupComplete.cmd” batch file as described earlier. Windows will not prompt you to create an account and the Admin account will be renamed.

    Sorry for the confusion

  • Matt Pickles

    After updating a build image, I get error “-1073425657” when running sysprep in “Audit Mode” with the “Generalize” option checked. According to Microsoft, this is because I’ve run sysprep too many times and the only way to reset is to completely reinstall the OS. This seems ridiculous if all I’ve done is updated an image with the latest MS updates and made changes to settings. How does one update an image with drivers, MS updates, etc. if we’re only allowed so many swings with the sysprep bat? There has to be some other way of resetting the clock, does anyone know how? Thanks in advance.

  • Trevor

    I may be a little confused, how do you insert the unattend.xml (answer file) into the image? I am trying to add the file to the image of Win 7 Enterprise, but it will not boot the disk anymore.

    If I leave the unattend.xml file on the machine, it will wipe it when i reinstall win 7 over top of it. I need assistance if anyone can help. Thanks.

  • EricZ

    If anyone wants to use KMS for auto acitivation, command “cscript //b c:\windows\system32\slmgr /skms x.x.x.x:1688” needs to be added to “FirstLogonCommands”, and run before the /ato command. (“x.x.x.x” is the kms server. “1688” is the default port kms server uses.)

  • Garvie

    Hi ITBros/Brian!
    Loved this tutorial and have used it quite a bit.I did some tweaks to my xml file to better suit my situation. I do have a question that anyone can feel free to answer.
    Once I finish in Audit mode I usually back it up in that state so I can then make additions or do updates down the road. This works fine but the only thing that gets me is the windows activation period. How do people deal with this? Is there a better way to do this?

  • Duke

    Removing the tag does get it to ask for the computer name but when it joins the domain it adds the computer with Winxxxxxxx name even though the machine has the same name that I entered during the setup. What gives?

  • Sean

    I saw a few comments in this thread which talked about the SID. Here is an article from the author of NewSid on why duplicate SID’s do not matter and also why Sysprep does matter.

  • emin cetinsoy

    and first of all thnx for that superb step by step tutorial.
    Just i would like to ask 2 things.
    Ive done everything then works perfect with sysprep but strange thing is when i start at last step sysprep command after few sec. windows starts to build new sys and kill my driver installations and their settings excp intel hd 3000 and hd 4000 drivers. after i install that image to new laptop it comes as a standart vga controller. did i missed something or should i done smthn more?
    and second thing is it takes every tweaks ive done excpt some task bar modif (for exp ive choose small task bar but it starts with large one.) and other thing is windows creates start menu shits from beginnig (like magnifier, paint, and other bullshits which my users doesnt needs) how can i fix them?
    any thougths?
    Thnx in advance..

  • jessica

    if I use sysprep to do the oobe thing, will it delete my files, I just want it to have my laptop run faster like it was brand new, any help would be great.

  • T800

    Apparently I had to stop “Windows Media Player Network Sharing” service before I could run /oobe /generalize, otherwise it gave me a fatal error.

  • Meff

    Is there a way to make it prompt for the windows activation key each time? We have a bunch of machines I would like to use the single oem activation key before buying a volume license.

  • kevin

    My systems are Intel 64 bit machines, not all of the amd 64 components you use are listed as either wow64 or x86 component system says it can not parse file if I use amd64 components is this the issue and if so how would I be able to resolve it.

  • Mrockwell

    I followed these exact steps and was running into errors when trying to add default printers into my customized profile. After running Sysprep and going through everything, whenever I try to do a test print from the machine, most (if not all) printers will show up with “unable to connect”. It mostly seems like a rights issue, but, I am basically at my wits end trying to figure it out. Any help would be greatly appreciated. Thanks.

  • Rick

    Now that we’re going to Win7 Enterprise, I’m using the .clg file from the Win7 Ent CD and using amd64 vs x86 answer files.
    My issue is, that I can capture/deploy our image fine. I’ve been asked to deploy our image to a machine, sysprep it, and send it off to the vendor to make a master image. When it returns, if the machine is booted up off the LAN or on, it creates another Admin profile in Users. The actual profile name is something like
    Administrator.(name of workgroup). What is causing this? The vendor says they use a temp account and delete it at the end of the unattend, and I don;t know why they would, or what function a Windows user account has during the unattend. I’m being pressured to find out why there is more than one Admin account created using the info above…while its always worked perfectly fine until we are trying out Enterprise. I’m told also that using Clonezilla will cause an additional profile to be created as well.

  • Matt

    I’m not sure what i’m doing wrong. I cannot get the finished image to boot. I captured the image with gimagex and converted the WIM to an ISO and copied it to a bootable USB key but I keep getting this error:

    “The boot selection failed because a required device is inaccessible”

    • Why are you converting to ISO? Are you trying to apply the .WIM image? If so, the simplest way to apply the image is using my WinPE 3.1 scripts ( which has the GimageX GUI and simply hit “apply” and select image. You could also put the WinPE scripts on the USB key and then simply select the .WIM file off of the same source to apply. Hopefully that makes sense.

      • Matthew Galiano

        Not following sorry. I booted to WINPe and captured the image using gimagex, so now I have a 5.11 GB wim file on my flash drive. So if I do not need to convert to an ISO what do I have to do to boot to this WIM?

        • Matthew Galiano

          Nevermind I figured it out. Thanks.

          • Great glad to hear it 🙂 !

          • Matthew Galiano

            Yes I appreciate your help Brian. I created the image and was able to deploy it to that machine through GImageX and it worked great. Here is my problem now. I have 70 additional machines with identical hardware and when I deploy the image to them it works but Windows does not boot. It starts up and continues to run the xml file and reboot, any ideas?

          • Matthew Galiano

            I get this error:
            Windows setup could not configure windows to run on this computer’s hardware

  • Darren J Taylor

    Hey buddy, how did you get rid of the “Windows setup could not configure windows to run on this computer’s hardware” problem?

  • David Brumbaugh

    Have you guys found out how to sysprep out the silly startup corner pointer getting started pictures when making a win 8 image ? sigh…..
    Dave, UF Gators….

    • Sorry that’s one thing we haven’t looked at yet 🙂

  • Upendra Gandhi

    Thanks for this setup. Really good information that even a beginer can learn how to do sysprep and carry on from here. I want to confirm one thing on Autologin of Administrator account. I understand when image is restored on a machine and that machine is booted, administrator account will autologin and some scripts will run in the background. You also suggested one can do further things such as adding to domain, etc. I found this worked fine. But when I rebooted that machine, the next time machine again logged into administrator account. Is this the way it’s supposed to be or it’s configuration error on my side. I don’t really want that the administrator logs in automatically except for the first login. If this is how it is supposed to be then, how can I disable auto login for administrator from second reboot. Rather than doing this manually, I’d prefer automating in unattend.xml, but no idea how it can be done.

    • darkflux

      you can change how many times you autologon in the unattend file under section 7:oobe system, under “amd64_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral”. the section that says “LogonCount” is set to 5 in the example unattend file above. you can set it to however many you want it, though you will often end up needing a couple reboots after imaging a hard drive, such as for Windows Updates, and any new hardware added. this just covers that, but you should be able to change that 5 to whatever works best for your scenario. just be sure you hang onto that unattend file, so you can be sure of what your settings were!

      • Upendra Gandhi

        Cool, thanks. I was leaning towards changing the number where you mentioned but I think I misunderstood something about it that the count always gets to original value, so I thought, if it is initially 5 and becomes 4 after first login, it will again reset to 5 after the reboot or any other number that is set for that matter. I will try setting it to 1 and see what happens..Thanks for your reply. Appreciate it.

        • it should only reset if you run sysprep again, though i could be wrong…

          • Sorry for the delay. Yes, you are correct darkflux… it you run sysprep again it will reset that counter.

            There is a section in the xml document to add to domain. The only reason we didn’t write this up is because from our experience everyone names their machines differently. Example, in our environment, it was for staff and faculty and so there was no way to script the renaming (because we included their name in the machine name) before joining it to the domain. Hopefully that makes sense.

          • Also make sure you both check out the newer version of this article: There have been some fixes and additional instructions added. Thanks

  • thanks for this. i shall use it well >:)

    • Your very welcome. Thank you for responding to Upendra below. We appreciate it.

  • PinYoProductions

    Hello Brian & fellow IT Pros! I have a quick question regarding if my PC’s are running Intel Core i-5 64-bit processors, Steps 3, 4 & 7 was using the amd64_Microsoft-Windows, but we’re running Intel, what should I choose for these steps? Any help or suggestions would be greatly appreciated! Thank you in advance! =)

    • Tommy Meyn

      It is only named amd because amd was the first manufacturer to make 64 bit. It works for both

  • CenterThinker

    I completed until point, when I boot into the BootLoader env, what do I do Next? I selected C: but I can not find or create a network location at this point. I’m running this on a VM (VHD) any help?
    Thank you.

    • what step are you at?

      • CenterThinker

        Hello Brian, I’m at step 14:Turn the computer back on and boot to WinPE 3.1 environment (USB stick or CD/DVD). You can use my theITBros WinPE3.1 BootLoader to boot up from USB or CD and capture your image. (Upto this point its OK) HERE IS WHERE I CAN NOT SAVE IT TO A NETWORK LOCATION —> Capture image and save image to network location.

  • Franklyn Arnett

    I am trying this for the first time. In my environment, I receive a corp image already prepared. But I would like to customize it and re-sysprep it before deploying.
    Is there a way to create a blank or generic answer file and just specify the copyprofile option so that I can modify a profile and then have it as the default for all users?
    I did try your steps below, but when I get to step 6 / 4 Specialize, I don’t get the options that you do. There is no ‘Order:1’ or WillReboot: for example. And no CopyProfile which is the importand one for me.
    I am using Windows 7 Ent 64bit as my image.
    Any ideas ?
    Any help appreciated.

    • Fid

      Hi there just like you i am also creating the unattend.xml file ……what i have found is that for step 4 you have to Right click on RunSynchronous and select “Insert new RunSynchronusCommand”

      try this
      i am using it as a reference for stuff that is missing here…..i am still not done creating it, but i hope this helps. 🙂

    • Sal Monella

      I found you need the registered owner and organization along with copyprofile in order for the actual profile to copy. Found this on another site. Weird bug.

  • Emanuele Missud

    I’m trying to use an unattend.xml file prepared before for a w7 32bit sysprep. I thought the simplier way to do a new sysprep was to use yhis answer file i just have and copy in the sysprep folder. But when i try to launch the sysprep command to finalize the image return me an error. Maybe i have to create a specific unattend file for my new W7 64bit version?

    • Alex G

      You would need to create a new unattend.xml for windows 7 64x.

      • Emanuele Missud

        I tried with another unattend.xml with amd64 architecture. The error is something like: “The answer file includes one or more elements of settings already processed.”

        • Alex G

          Sounds like the XML is corrupt. I would try to reopen the XML with the WISM, see if you get an errors. If so, start again.

          I had some issues when I saved the XML as a different name then tried to rename, may have just been a coincidence.

          • Emanuele Missud

            You are right. Cannot open the answer file with WSIM… error at line 3. So i’m gonna create a new one. What i need is an image that only prompt for computer name after my restore. I don’t want to create any local user account. The second step is a join-domain script starting only once at first logon. Please can you help me to understand what are the components involved?

          • Alex G

            Sorry I don’t use the join the domain scripting. I tried script with XP that worked but was a bit clunky. I prefer to join manually.

          • Emanuele Missud

            I resolved creating a brand new answer file copying settings from my old xml file… and sysprep works fine! To run the join script i added in the ShellSetup component of the oobesystem settings the following:

            More complex to not create the first logon user account: you have to enable Administrator user in shellsetup e in system restore component.and set password.
            Thank you for your support!

  • Emanuele Missud

    I’m trying to use an unattend.xml file prepared before for a w7 32bit sysprep. I thought the simplier way to do a new sysprep was to use yhis answer file i just have and copy in the sysprep folder. But when i try to launch the sysprep command to finalize the image return me an error. Maybe i have to create a specific unattend file for my new W7 64bit version?

  • Firekeeper

    Why do I randomly get after sysprep under Users Administrator empty folder and Administrator.Computername? Anyone bump into this? I have copy profile true in xml.

    I captured with and without administrator account enabled no difference. Reference computer in a vm – clean install 7 ent x86 – audit mode, never joined to domain. I even try to specify another local account and delete it at setupcomplete again randomly appears that emply folder Administrator and Administrator.Computername. Please help I have done every ideea found on net diffrerent approaches randomly works…

  • steve

    how do i make it so that it does not join the domain?

  • bob

    in the process of automating my universal image, i have the computer renamed from a property in ZISD (zenworks image safe data). after the PC’s renamed, it does not continue to autologin. does anybody know if renaming the PC would conflict with autologin that was configured from the sysprep unattend file?

  • Διονύσης

    Thank you very much for the very good work you have here. It help me a lot.

  • Microsoft FPP Product keys are sensitive case, Because Microsoft provide it for only one system at the same time, I was need the windows 7 key for my laptop to upgrade from home premium to professional, So I contact to Microsoft but they denied to give me a sigle fpp key, So I searched globally to purchase it.
    Recently, I ordered via a site from India, They provided me 3 windows 7 pro oem keys with their stickers and 2 windows 8.1 pro oem keys, Which is legal and working good. I’m happy after getting so cheap oem licenses.
    You can also get an unused Windows 7(any version)8, 8.1 pro License key from: ODosta Store
    Otherwise, FPP keys are very costly, Usually it come with full package with DVD media, So I suggest to buy oem keys, Which has branded from Dell, Hp, Lenovo etc, As its mean “Original Equipment Manufacturer” Goods.

  • GrizzlTooth

    This is a great article but I have a question or two. When I capture an image, I start by loading the base image by disc on the machine I”m capturing from. I use a service account with admin rights to install and update. For now, let’s call it ServiceAccount1. The problem I’m running into is that when I sysprep, the OOBE is still prompting me to create a username. It seems the only way I can get around it is by using sysprep xml file to code in an additional service account creation at setup, ServiceAccount2. What I’d like is to find a way to skip the OOBE part that prompts for creation of a user account. Are these instructions above providing for that or is there another way to do this?

  • Jonathan Schaumloeffel

    I just want to create an answer file that ONLY copies the administrator account using the “copy profile” I don’t want to automate the windows install process. Is there a way to do this? I feel like I am missing something simple.

  • Ishmal Jutt

    Windows xp activation support has been ended whereas windows 7 support has been over, but there’s no doubt, As Windows 7 is the most recommended OS, Which through user can do almost all work without any problem, Where I recommend you to activate your OS being purchased its license code from ODosta Store
    Which is distributing license for almost all types of Microsoft Products. I personally use it and have a good experience.