Imaging Windows 7 using sysprep.

Posted on 2013-11-14
Last Modified: 2014-04-27
I am trying to build an image of Windows 7.  I installed Win 7 open license, install all apps and drivers on the system.  I have stopped the windows media player under processes and I go in and run sysprep to go into audit mode, generalized and reboot.  At this point my system tries to reboot and gives me an error of Windows can not finish installation and to finish configuring to restart.  Click OK is all you can do and the system restarts and comes right back to the same error, after trying several things I believe I am back at rebuilding my image for the 3rd time and attempting again.  Can anyone give me any insight on what might be happening here.  I have found several postings but haven't really found anything that seems to completely match my issue.
Question by:sentinelfcu
  • 5
  • 3
LVL 32

Expert Comment

by:Rodney Barnhardt
ID: 39649160
Since you do not specify the error you are getting, it could be an activation problem.

"open a command prompt, type: slmgr /dlv to view how many times of remaining Windows Activation count. Generally speaking, to sysprep the image on a single computer for multiple times, you need to configure the Microsoft-Windows-Security-SPP | SkipRearm to 1 in the unattend.xml file. I am assuming whether you configure the Microsoft-Windows-Security-Licensing-SLC | SkipRearm to 1 instead of SPP, the SLC setting is deprecated and should not be used.  

As a work around of this problem, please type: regedit in the Start Search box to open Registry Editor, set the value of GeneralizationState under HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus to 7, then run sysprep again.

If the same issue still persists, please unistall the MSDTC and Reinstall it, then try the sysprep.
To uninstall MSDTC :- msdtc -uninstall
To reinstall  MSDTC :- msdtc –install"

Author Comment

ID: 39649196
I really don't know how to specify the error cause I can not get to any logs, once it reboots to audit mode I cannot get any further or go back.  I will try this and get back with you, I need to rebuild the system again before I can do any of this because the system boots into a screen showing that setup is being ran for the first use and then goes black and then to a windows error recovery screen to choose how to boot.
LVL 95

Expert Comment

by:Lee W, MVP
ID: 39649861
It's not clear what order you're doing but I'm rebuilding an image today and tomorrow.  The correct procedure is:

0. Create an Answer File from the ADK.
1. Install Win7 Pro or Enterprise via VL media
2. At FIRST boot of Win7, press CTRL+SHIFT+F3 to enter audit mode (this is the screen asking for the computer name and user)
3. Install all apps, updates, etc that are appropriate.  Reboot as needed (IGNORE the sysprep reboot prompt that comes up - don't use it or if you use it, MAKE SURE you don't set it to OOBE until you're done and ready to seal the image.
(I use the script below to run sysprep)
4. SHUTDOWN - DO NOT REBOOT. Capture the image.

@echo off
set PathToUnattend=\\server\share\path\unattend.xml
REM Clearing screen to get rid of error about UNC paths being unsupported.
Set SetupComplete=%windir%\setup\scripts\SetupComplete.cmd
if not exist "%windir%\setup\scripts" md "%windir%\setup\scripts"
echo if exist "%windir%\system32\sysprep\unattend.xml" del /q /f "%windir%\system32\sysprep\unattend.xml">%SetupComplete%
echo if exist "%windir%\panther\unattend.xml" del /Q /F "%windir%\panther\unattend.xml">>%SetupComplete%
copy "%PathToUnattend%" "C:\windows\system32\sysprep">nul
If exist %SetupComplete% (
	Echo The %SetupComplete% file was found; 
	Echo contents as follows:
	Echo ==========================================================================
	Type %SetupComplete%
	Echo ==========================================================================
) Else (
	Echo %SetupComplete% file was NOT FOUND!  Aborting!
	Goto End
If Exist "C:\windows\system32\sysprep\unattend.xml" (
	Echo The UNATTEND.XML file was found!
	find /i "copyprofile=true" "C:\windows\system32\sysprep\unattend.xml">NUL
	If "%errorlevel%"=="0" Echo Found COPYPROFILE=TRUE - Profile used in setup will be set as default!
) ELSE (
	Echo UNATTEND.XML was NOT FOUND!  Aborting!
	Goto End

If Not Exist c:\temp md c:\Temp
If Not Exist "C:\AboutThisImage.txt" (
	Echo No "About This Image.txt" file found in C:\
	Echo Please create a text file by this name and include details about 
	Echo this image, including what was initially included, the build date
	Echo and other significant information before you continue this script.
Echo To execute SysPrep:
Echo Running sysprep...
CD /d c:\Windows\System32\sysprep
sysprep /generalize /oobe /shutdown /unattend:unattend.xml

Open in new window

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.


Author Comment

ID: 39663655
There was some other items that have come up that needs my attention, but when I try to make my answer file it is failing with the error of parameter count mismatch.  I am in the process of resolving this issue before I can attempt this again.
LVL 32

Expert Comment

by:Rodney Barnhardt
ID: 39664019
That usually indicates a permission error. Possibly, the location where you are writing the answer file.

Author Comment

ID: 39664067
I tried writing the file to the local which I have local admin permissions, I have tried writing to network share which I have admin permissions on, I have even tried writing it to my documents folder on the network which I have full permissions to.  All of them come out with the same error.
LVL 32

Expert Comment

by:Rodney Barnhardt
ID: 39670072
There is a Microsoft KB for a parameter mismatch error. I am not sure if it would apply, but you could check it out.

Accepted Solution

sentinelfcu earned 0 total points
ID: 40015491
I apologize for not getting back to this question, but what I ended up doing was having the image save to the original hard drive and then copying the .wim file from the original drive to another usb drive for deployment to other systems.  I appreciate everyone's help here and again I am sorry that I didn't get back to this sooner.

Author Closing Comment

ID: 40025531
Found my own answer which worked.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to make the default printer settings to all the users? 2 37
BgInfo help 5 66
Windows server 2008 exchange 3 29
Hide shared folder for some users 2 32
Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
An article on effective troubleshooting
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question