SPREAD THE WORD, TOGETHER WE HAVE CONQUERED SYSPREP
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 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.
Here is a list of what you will need:
- Latest version of WAIK : KB3AIK_EN.iso Version 1.0
- 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 : BrianLeeJackson WinPE 3.0 BootLoader
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.
PART 1 – XML FILE CREATION
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:
Step #3
Under the “Windows Image” header, right click and select new image.
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.
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.
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
amd64_Microsoft-Windows-Security-SPP_6.1.7600.16385_neutral
Set 1 for SkipRearm to allow up to 8 rearms
4 specialize
amd64_Microsoft-Windows-Deployment_6.1.7600.16385_neutral
Order: 1
path: net user administrator /active:yes
WillReboot: NeverRunSynchronousCommand[Order="1"]
RunSynchronous
amd64_Microsoft-Windows-Security-SPP-UX_6.1.7600.16385_neutral
SkipAutoActivation: true
amd64_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral
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 -> http://technet.microsoft.com/en-us/library/cc749073%28WS.10%29.aspx)
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
amd64_Microsoft-Windows-International-Core_6.1.7600.16385_neutral
InputLocale: en-us
SystemLocale: en-us
UILanguage: en-us
UserLocale: en-usamd64_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral
RegisteredOrganization: Your Company Name
RegisteredOwner: Your NameAutoLogon
Password: Administrator Password
Enabled: true
LogonCount: 5
Username: administratorFirstLogonCommands
CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX (windows 7 license key)
Order 1
RequiresUserInput: falseCommandLine: cscript //b c:\windows\system32\slmgr.vbs /ato
Order 2
RequiresUserInput: falseSynchronousCommand[Order="1"]
SynchronousCommand[Order="2"]
OOBE HideEULAPage: true
NetworkLocation: Home
ProtectYourPC: 1UserAccounts
Password: Administrator Password
Action: AddListItem
Description: Local Administrator
DisplayName: Administrator
Group: Administrators
Name: AdministratorLocalAccount[Name="Administrator"]
AdministratorPassword: Administrator Password
LocalAccounts
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
PART 2 – IMAGING PROCESS / RUNNING SYSPREP
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:windowssystem32sysprep. 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.0 environment (USB stick or CD/DVD). You can use my BrianLeeJackson WinPE3.0 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!
Tags: Software, sysprep, unattend, unattend.xml, Windows 7, WinPE 3.0









Hi Brian,
Thanks for this, hopefully it will be a big help to me. I do have a few questions though. What if I wanted to use a specific account to have the computer log onto the domain? Could I have added those credentials under 4 Specialize amd64_Microsoft-Windows-Shell-Setup_neutral section? Also, I have already created a profile which I will be using as my default. I have read, in order for that to work, I will need to be logged in under that profile last. Is this true. Finally, I will have a drivers directory in the root of C that will have drivers for the various versions of hardware that I will be depolying this image too. Is the audit mode under sysprep the only time I can add drivers? What about using the drivers path within the unattended.xml? Will that work also? Thanks
Hello, i read ur article and found that it is based on audit mode of a new installed system, i would like to ask what is the correct procedure of doing a sysprep of multiple time on the same system? because if needs to build up a new image needs to install the system again, seems quite consume time
May i know using this method allowing me changing my motherboard and cpu from P965 chipset C2D E6300 to newer platform Core I5 750 or AMD base mainboard and cpu wihtout reinstalling windows 7 home premium 64bit. TQ
@Daniel: Np! Good luck.
@Kyle: The cscripts for activating windows runs right upon first Administrator login. This is so the real users in a work environment don’t see anything.
@Michael Jude: 1) No, the drivers are added by their *.inf extensions. Have you read through my DISM article?? http://blog.brianleejackson.com/deployment-image-servicing-and-management-dism-winpe-3-0-boot-environment This talks about adding drivers and GimageX. Step #5 especially shows you the command to add the drivers. The nice thing over WinPE 2 is that WinPE 3.0 now has a recursive lookup command with DISM so you just drop all the driver folders into a folder on your desktop and run the command at that one folder and it will scan all the folders and subfolders beneath it and extract the INF/dll files needed and add them to your .WIM. No picking or manually adding necessary. Very nice! Although, make sure you have unzipped your drivers that you download.
2) Yes, you will need to net use to a network share. However, you can see in my WinPE boot environment that I provide to download here –> http://blog.brianleejackson.com/winpe-3-0-boot-environment-scripts Step #2 launches GimageX app, but I have it pointed to a batch file that runs a net use to a network share. If you download my WinPE boot environment you can simply edit that batch file with the network share of your choice. You hit #2, it prompts you for your username and password to that network share, and boom, GimageX is launched with your mapped network drive ready to either browse for your image or apply and save your image.
I hope that answers your questions. And as always, happy sysprepping (now a verb)!!
@tribal: Yes, however I do recommend adding some third party drivers, but yes, if you take a syprepped image it will now work on different brands, etc. This start up time after imaging is a little longer because it goes through configuration…. page,, but who cares if you have to wait anther 5 minutes if your one image works on everything
I would recommend reading my article here -> http://blog.brianleejackson.com/deployment-image-servicing-and-management-dism-winpe-3-0-boot-environment on an easy way to add extra third party drivers. The Microsoft configuration will still not pick up everything 100%, but so far I have two images, one x32 and one x64 and have been using it on around 40 different models ranging from Dell, Asus, Toshiba, HP, Acer, etc. and it is about 90% accurate as far as device manager goes. After a while you can build up a nice image with 100% accuracy and save hours and hours of work. Some student workers could be losing some jobs
@Mark Scott: Hey, thanks for the compliment. I’m glad I could help and hopefully save you some time. Make sure you check out my article on DISM: http://blog.brianleejackson.com/deployment-image-servicing-and-management-dism-winpe-3-0-boot-environment and my WinPE 3.0 boot environment disc : http://blog.brianleejackson.com/deployment-image-servicing-and-management-dism-winpe-3-0-boot-environment. I will be posting updates soon about domain joining script. I am currently testing different ones and want it to be a good and secure solution for auto joining to domain before posting it; and yes, possibility of pointing to correct OU. Keep checking back! Happy Sysprepping!
@bkz81 : You need to read my article on DISM: http://blog.brianleejackson.com/deployment-image-servicing-and-management-dism-winpe-3-0-boot-environment. Look at Step #5. I am going to copy what i commented to Michael Jude just a few minutes ago “This talks about adding drivers and GimageX. Step #5 especially shows you the command to add the drivers. The nice thing over WinPE 2 is that WinPE 3.0 now has a recursive lookup command with DISM so you just drop all the driver folders into a folder on your desktop and run the command at that one folder and it will scan all the folders and subfolders beneath it and extract the INF/dll files needed and add them to your .WIM. No picking or manually adding necessary. Very nice! Although, make sure you have unzipped your drivers that you download.”
Hope that helps! Happy Sysprepping!
@Jonathan Shapiro: You are very welcome, I hope it saved you some time; that was my goal. Yes, you are going to have to tweak your sysprep a little. I am currently using a VLK license which allows for multiple PC’s on the same license key. But only big business’s or educational institutions usually get VLK licenses. However, we are soon switching to a KMS server for activation at my workplace so the script for auto activating will no longer be necessary as the KMS server activates Windows 7 machines within a domain, I think by their mac address or IP range. For your sysprep, I guess the only way to do it is to take out those cscript entries in the answer file, right under FirstLogonCommands. And manually walk to each PC after they have imaged and input the license key. Unless someone else has a creative way to active PCs. How many computers are you imaging?
@Chris: Glad I could help. Do you mean specific account to login to domain or to join domain? There is a difference. Also, are you trying to create multiple profiles?? That could get messy. Audit mode really only deals with the Administrator profile and that is it. When you first boot up into audit mode, you customize, you run sysprep which copies that profile to the default user profile and then it deletes the administrator account. Also, for adding drivers, a much easier and more space efficient way to do this is after you capture the sysprepped image. Read my tutorial on DISM: http://blog.brianleejackson.com/deployment-image-servicing-and-management-dism-winpe-3-0-boot-environment Step #5 is where you would add all the third party drivers you want with one recursive lookup command. It pulls what it needs and leaves the rest of it out, like documentation, etc. that just waste space. Much more efficient, saves times, and saves hard drive space.
@Daniel: Here is my recommendation. This is what I do. Take a non-sysprepped image of your computer while it is in audit mode after you have finished configuring all your stuff. Then if you want to update stuff later simply apply that image back down, update your new software, run sysprep and capture your new image. It does mean capturing two images, one while audit mode is running for fresh backup and then capturing an image after you have ran sysprep command for deployment to other PCs. That is the best way I have found to do it. I only update images around every 4-5 months so it doesn’t waste that much time to take two images.
@Bobby: Yes, as long as it is 64 bit to 64 bit it should work just fine, even with different chipsets. I have a universal windows 7 image that I have working on about 10 different chipsets. You would want to make sure you have all the third party drivers added just to be safe under step #5 in DISM: http://blog.brianleejackson.com/deployment-image-servicing-and-management-dism-winpe-3-0-boot-environment. Microsoft configuration at startup after sysprep still doesn’t find everything. However, you would have to sysprep your machine too. This is some work, but I guess would still be worth it, if you have a lot of stuff on your machine that you don’t want to redo. I would definitley take a non-sysprepped backup image first though just in case something goes wrong. Good luck!
Brian:
Anyway, we are deploying about 60 computers initially, but after that, I suspect it will be a few here, a few there… We ususally don’t buy that many systems in one shot, but we took advantage of some year-end tax breaks to get these machines. They all came with Win7 Pro licenses. All are x64.
As you said, it is probably easiest for us to input a key/activate manually, but there are probably some gotchas with respect to blowing out and reimaging a system this way. For example, how many times will MS let us reimage a machine and reactivate it? Still, as a small/medium business, we buy our computers with the OS.
For now, I guess I will try stripping out slmgr scripts.
Brian et al:
I syspreped the Win 7 Enterprise again following your steps (V2) and almost everything works. Still a couple of details that I need to do the “old way”. For me it is better to use “MySysprep” to ask for the computer name and successfully join Active Directory. If I wait until Windows ask for the name of the computer the AD auto join already timed out (I can join AD after Sysprep is done, but it is just easier to do it all at the same time).
About the Copy Profile function, it works but the “keyboard inputs” (I want to have US-International, Spanish International and Chinese, both Taiwan and PRC) and the “task bar” icons are not copied over the Default Profile. Does anyone have idea of how to make those two things part of the Default Profile?
Other than that, your instructions are as clear as water.
Thank you again,
Carlos
Thanks for the quick response Brian. I did have a couple problems afterall when I pull the image down on a different computer than the one I created the image on:
The only thing I did different than your plan was I captured it with WDS Capture.wim.
1. Just after WDS finishes the image push just before it reboots it gives this error: “Windows could not apply the unattend settings durring pass (null).” If I click OK it appears as though it goes through and finishes everything (at least on the orginal computer)
2. When I bring the image down on another identical PC (Optiplex 330) after the image comes down I get BootMGR is missing. The orginal images had a Partition 1 Disk 0 and Partition 1 Disk 1. This one did not so I duplated those partitions and still get the same error.
Thanks again for all the help to us struggling to catch up.
Brian,
Thanks for the feedback. The account of reference actually joins the computer to the domain. I am actually only creating one profile, a default profile to be used by everyone. It is exactly how you described it, only with a different account. As a matter of fact, that’s how I did it in XP, accept it was manual, the copying of the profile, change permission to Everyone>rebooting>then logging in as the Administrator to delete it the account the login and test it to make sure the settings were kept.
Also, under th locale options if I do not chose a language, will I get prompted to set my regional and language settings?
Is there a limit to the number of times a computer can be rebooted in “audit” mode? I was working on setting up the Win7 machine to be imaged (Windows 7 Professional, 64-bit on a Dell Optiplex 780). I did the ctrl-shift-f3 and got into audit mode just fine. I then got the latest Win7 updates (required a couple of reboots). Then started installing software. I installed Office 2007 then checked for updates. While applying the Office 2007 SP2 update, I was prompted to reboot again. So I rebooted and now Windows will not load. Instead I get a screen that says “Setup is preparing your computer for first use” on a black background. There is also a pop-up dialog that says “Windows could not complete the installation. To install Windows on this computer, restart the installation.” There is only an “OK” button and pressing this reboots the computer, which then returns to this screen (endless loop). Any ideas?
Btw, THANK YOU very much for this guide. I was pleasantly surprised to see a revised v2 when I got on today (I had mentally been keeping track of all the various comments made in the last thread but was sure I’d forget something).
Brian,
Thank you for this blog!
I’m having some trouble. I was wondering if you could help. I’ll try to be brief.
I followed your tutorial to the T 3 times.
I can’t get it to work yet.
1. When sysprep is running, I get a prompt to uninstall drivers, but I don’t want to uninstall any drivers. It forces me to click ok to proceed. Then I get the “this program installed correctly or Reinstall this program using recommended setttings” prompt. So I click This program (un)installed correctly and move on. Computer shuts down.
2. The computer will not boot back up. It comes to the Windows Boot Manager screen telling me Windows failed to start. A recent hardware or software change might be the cause. To fix the problem: 1. insert installation disc 2.choose language settings 3. click repair your computer.
file: \Windows\system32\config\system
status: 0xc000014c
Info: Windows failed to load because the system registry file is missing or corrupt.
I’m about to bang my head:(
Brain et al:
Do I still need to enter the product key if I’m using a KMS server for activation? Also, under the AutoLogon section is that a local or domain level account? Would it matter if I wanted to specify resolution? Thanks everyone again for your help with this.
I tested the sysprep.xml today for the 1st time — I’m pretty sure I had every setting identical to yours. I noticed that in step #8 you said to remove the computername line from the .xml file. That line does not appear in my .xml file. I poured over it several times but the only time a computername shows up in the .xml file is if I enter one in the shell-setup in pass 4. I deployed anyway just to see what would happen and of course I was not prompted for a computer name. Any suggestions?
Thanks,
Joe
Hi Brian,
Thanks for the tremendous effort you’ve put forth here! It’s always a struggle to figure out the best way to do things and with 7 Microsoft has thrown so many tools at us it’s crazy! Refreshing to find the illustrated plainspeak demo you’ve put together. Thanks so much!
I am a ‘desktop specialist’ at a small college and we have VLK. I’ve been using an autounattend.xml file built per MS’ step by step instructions with the Win7E DVD and only yesterday did I finally GET what the audit mode was all about. That was a huge DUH!! I like your idea of taking an image of the fully outfitted, non-sysprepped system for later updating.
With audit mode, is it still necessary to set skiprearm to 1? And since the oobe run of sysprep forces creation of a local admin account, why do you recommend creating one in the xml file? Just wondering.
*edit
I found the component in sysprep to help with drivers. I added PNP SYSPREP NEUTRAL to pass3. DoNotCleanUpNonPresentDevices set to TRUE and PersistAllDeviceInstalls to TRUE.
I wasn’t prompted for removal of drivers but the computer would still not boot back up and gave the same errors. Any ideas anyone?
If it helps, I have about 200 Dell XPS ONE’s. I’m assuming they all have the same hardware etc.
(I’d also be willing to INSTALL drivers during first boot if I can’t get it to work this way but I haven’t begun to look at that yet)
Brian,
ok i am new to this GImagex application or the whole process of WIM, i’ve been using Ghost in the past. After the system is ready to be captured. i am a little confuse at this point. In GImagex, the source will be “D drive, or where the windows files are” but what about the C drive or system drive. I was able to to create a WIM file, but when deploying it to another system, i get missing bootmgr. press ctrl+alt+del. If i apply the WIM back to the same machine i capture the image from, it works from there. what am i doing wrong.
Brian:
I made some progress since my last posting and I would like to share it. It is related to the during sysprep to be able to have more than one Regional Language and keyboard Layout. It is really important for us since this is a Language Lab at the Department of Foreign Languages & Cultures. Even if all the Microsoft forums claim that this is to be used only on XP and Vista computers, this is the code I included in my sysprep.xml and it works:
On
0409:00000409;0409:00020409;0c0a:0000040a
en-us
en-us
en-us
Those numbers are English US, US International and Spanish International.
Good luck!
Carlos
Brian:
I made some progress since my last posting and I would like to share it. It is related to the during sysprep to be able to have more than one Regional Language and keyboard Layout. It is really important for us since this is a Language Lab at the Department of Foreign Languages & Cultures. Even if all the Microsoft forums claim that this is to be used only on XP and Vista computers, this is the code I included in my sysprep.xml and it works:
NOTE: Quotes are supposed to be grader than symbols.
On “settings pass=”oobeSystem”" “component name=”Microsoft-Windows-International-Core”
“InputLocale”0409:00000409;0409:00020409;0c0a:0000040a “/InputLocale”
“SystemLocale”en-us”/SystemLocale”
“UILanguage”en-us”/UILanguage”
“UserLocale”en-us”/UserLocale”
“/component”
Those numbers are English US, US International and Spanish International.
Good luck!
Carlos
Maybe I am a little off or it is late but I am trying to create a very plain vanilla Dell Image for the 960/380 and maybe a few vostro machines. If I follow this exactly when do I push this up to my WDS server? I was hoping to push this directly to the WDS server for easy pc deployment.
Hey Brian,
Did everyhing you said but still getting the: “Windows could not parse or process the unattend answer file for pass [specialize]. The settings specified in the answer file cannot be applied. The error was detected while processing settings for component [Microsoft-Windows-Shell-Setup]” error. Don’t know what to do. Please help. I have attached my XML code below.
-
-
-
1
-
-
-
-
1
net user administrator /active:yes
-
true
-
Eastern Standard Time
false
true
true
-
-
en-us
en-us
en-us
en-us
en-us
-
-
-
RABpAG4AawBlAGwAMgAyAFAAYQBzAHMAdwBvAHIAZAA=
false
true
5
administrator
-
-
1
cscript //b c:\windows\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
false
-
2
cscript //b c:\windows\system32\slmgr.vbs /ato
false
-
true
Work
1
-
-
RABpAG4AawBlAGwAMgAyAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA==
false
-
-
-
RABpAG4AawBlAGwAMgAyAFAAYQBzAHMAdwBvAHIAZAA=
false
administrator
administrators
administrator
Local Administrator
MSCG
MSCG
Hey Brian,
Did everyhing you said but still getting the: “Windows could not parse or process the unattend answer file for pass [specialize]. The settings specified in the answer file cannot be applied. The error was detected while processing settings for component [Microsoft-Windows-Shell-Setup]” error. Don’t know what to do. Please help. I have attached my XML code below.
-
-
-
1
-
-
-
-
1
net user administrator /active:yes
-
true
-
Eastern Standard Time
false
true
true
-
-
en-us
en-us
en-us
en-us
en-us
-
-
-
RABpAG4AawBlAGwAMgAyAFAAYQBzAHMAdwBvAHIAZAA=
false
true
5
administrator
-
-
1
cscript //b c:\windows\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
false
-
2
cscript //b c:\windows\system32\slmgr.vbs /ato
false
-
true
Work
1
-
-
RABpAG4AawBlAGwAMgAyAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA==
false
-
-
-
RABpAG4AawBlAGwAMgAyAFAAYQBzAHMAdwBvAHIAZAA=
false
administrator
administrators
administrator
Local Administrator
MSCG
MSCG</Registe
Hi Brian,
Im having problems with this i set up the sysprep file the script file install the os go into audit mode all fine and i run sysprep fine. The only difference is im using a wds server and using the capture image that comes with WDS. So i upload the image up to the WDS server No problem but I keep getting prompted for the details that already in the sysprep.xml file like language settngs username and so on. Is there im missing or can i not set this up this way with a wds server. Maybe i should create a unattend xml file and attach it directly to the image in WDS. Any ideas?
i`ve many problems with the software i`d like to install.
when my pc reboots (automaticly logged in in as admin) some apps wont`t start.
office 2007 will not start.
it searches for files in c:\mso\
and some desktoplinks have no icons
Brian
My sysprep is still not working. But I have narrowed it down a bit more. I ran sysprep with NO answer file and it still bombs the same way: Sysprep runs and shuts the computer down, but when I boot it back up, it takes me to the Windows Boot Manager screen. Anyone have any ideas?
Follow-up on my previous comment about the “Windows could not complete the installation” error:
I went ahead and started over – formatted the computer and re-installed Windows 7. What I had done last time was used an Office 2007 customized installation hive that I had created on a Windows XP 32-bit machine a while back. I’m wondering if this was conflicting with the Windows 7 64-bit installation. So this time I just installed Office 2007 from the CD and then applied updates. Everything is still working fine and I have not seen that error again. I’m not certain that this was the cause but I would recommend installing office 2007 from the CD and not using a customized version in audit mode.
Brian, my hero,
I did same what you said and after the first reboot i got ” Windows could not complete the installation. To install Windows on this computer, restart the installation ”
the only thing different is I enter the Product key in the sysprep.xml.
false
Pacific Standard Time
true
XXXXXXXXXXXXXXXXXXXXXXXXX
HELP!!!!! If anyone can help me that would be great. I have to have an image ready to ship to South Africa by Friday.
After capturing an image following the steps above i get and error:
File: \Boot\BCD
Status: 0x000000F
Info: An error occurred while attempting to read the boot configuration data.
running BCD tools from the WINPE disk built with your tools here does not fix either.
Here are the steps I have tried no listed here.
-When installing from Disk i have tried both letting it create the 100 MB system partition and still get the error. I have tried deleted the second partition and extending the system partition so that Windows installs on just one partition and still get there error.
The only thing I am doing different is using WDS Capture.wim to capture the image.
My stress level has just about had it!
Thanks in advance for everythign you have done to help all of us!
sorry, it’s me again…seems so many question, after i syspreped the computer, i turned it on, and it booted, at the stage that it said “Windows is try to start services” ,there is a windows box said ” Windows cannot setup this computer at the moment. If you would like to try again, you may restart your computer.” Press Ok it will reboot anf it will forever loop to this windows box, i checked the sysprep.xml in the image manager , it seems following this blog correctly, do you have any clue that i may have done anything wrong?
*Update* – My sysprep.xml file was not prompting me for a computername. I remade the .xml file and started getting the parse error someone else mentioned. I was meticulous about creating the .xml file but couldn’t get it to work perfectly. I copied the install.wim file from my DVD back to my hard drive and selected it as a new windows image before recreating the .xml file — works perfectly now. Not sure what the issue was (possibly user) but it works exactly as intended now.
OK… Scratch that last one. I think I have that one conquered now on to a new problem.
-Build my reference PC on one partition
-Audit mode make a few changes and add sysprep.xml and script folder
-rurn sysprep
-capture image to new WDS server
After the capture I let the reference computer boot up all the way to make sure sysprep ran and my changes stuck and the key activated and it did.
-Bring the image down on another like computer that was captured after deleting the 2nd partition and extending the system partition.
Now this one goes true all the user setup and EULA like it never had a sysprep.xml file to look at.
I’m really lost on this one cause I know it works on the reference computer.
Hi Brian,
Just wanted to get back to you concerning my original issue….
========================================
Hi Brian,
Thanks for the tutorial and all your hard work on this. I have experience in creating images using Ghost with Sysprep in Windows XP, however, with Windows 7, this is completely different. I am having some difficulty running the command with the unattended file, so, I will try to explain below. Thanks for your help.
I downloaded one of your .xml file (one for the 32bit version of Windows 7) and rename it to sysprep.xml. The version of Windows I am using is Windows 7 Professional 32 bit. I modified some of the fields like company name, and computer name, however, when I try to run the command below from a command prompt, I would get an error.
My command prompt path is C:\Windows\System32\Sysprep
sysprep /generalize /oobe /shutdown /unattend:sysprep.xml
So when I execute the command above I would get an error that says;
“windows could not parse or process the unattend answer file [sysprep.xml]. The specified file does not exist.”
The file is indeed in “C:\Windows\System32\Sysprep”
Is there something wrong that I am doing? Could you please help?
=====================================
It turns out that in order to run this command
sysprep /generalize /oobe /shutdown /unattend:sysprep.xml
you must log in as Administrator and not a user that is a member of the administrator group. Your XML file work just fine, there was nothing wrong with it.
Thanks again…………and excellent tutorial……
In case someone is interested in having more than one keyboard layout, including IME (for Chinese, Taiwanese, Japanese, etc), very useful at the Dept of Foreign Languages, create an xml file with the following code: (without the “quotes”).
“”
“”
“”
“”
“”
“”
““”"
““”"
““”"
““”"
““”"
““”"
“”
“”
Hi Brian,
thanks for your interesting blog.
While doing an image I ran into the following problem:
when windows reboots (at the point, where the services are started), I get an error: configuration of the system failed. Please reboot.
When I reboot, i get the same error again.
After trying different things, I noticed that if I don`t generalize the image, I don`t get the error.
Has somebody an idea whats going wrong or even a solution?
Best regards,
Micha
Hi Brian I know you are well busy and that you are the sysprep god but I also have the same issues as Mark Scott (January 26, 2010 at 10:36 am) with BOOTMGR missing. is there any fixes as of yet? I am using Windows 7 Enterprise 32-bit will that make any difference as I will be trying to activate with KMS server but would that still be causing an issue with booting because it does excally what Mark Scott describes. Thankyou in advance
Kye – Deems like my issues have something to do with WDS. I was able to capture the images with imagex and deploy with imagex with no problems. Are you using WDS?
Hi Brian, your article together with all added comments is the most useful documentation for deploying custom Windows 7 images was able to find.
However, would you be able to help with the following – it would be sufficient to give me some hints how to continue:
- I successfuly created custom Windows 7 image using sysprep and imagex and I am able to roll it out to computers, but only using unicast
- I would need to use multicast when rolling out images
- I installed Windows Server 2008 R2 and configured WDS (created multicast session for the custom Windows 7 image)
- I am able to use PXE and start standard Windows 7 boot image from WDS, join multicast session and copy data to local computers
- but after all data from image is copied and expanded to a local computer, the OOBE doesn’t take into account unattend.xml, instead it starts standard OOBE (prompts for locale, asks to add user)
What I am doing wrong? How I should deploy custom Windows 7 image using multicast feature of WDS? Should I use standard Windows 7 boot image? Is it possible to boot Windows PE and instruct imagex.exe to join multicast session?
I tried to find answers to my questions elsewhere, but without success. But perhaps you or those who comments your great article would help me in this.
By the way, other tricky topic is how to successfuly use custom computer name and join a domain. I think I am not the only one who checks your blog on daily basis if there is a new article:-)
Hello Brian,
First let me say this has been a tremendous help in these busy times. I followed your steps and all has gone smoothly except when I am at the Apply Image stage. Syspreped the computer, booted to GIMAGEX, selected the source of my .WIM which is on the network (mapped drive), then selected D: as destination. When I click on Apply I receive these errors:
ERROR: D:\autoexec.bat [err=1812]
ERROR: Error applying WIM
Error: The specified image file did not contain a resource section
I’m almost sure I am doing something wrong or have missed a step so your help would be greatly appreciated. Thanks again.
Brian
Steps 9-13 look good for a new system build, but what about making a change to the image later? Let’s say you’ve taken your snapshot, but you want to install some app on the image and re-capture it. What would you do to bring down the image, install the app and re-capture? And how many times can you sysprep?
@ Kyle
You need to use BCDboot to initialize the Boot Configuration Data (BCD) store and copy boot environment files to the system partition.
Boot using your WinPE disk and then at the command prompt, type following command below;
C:\windows\system32\bcdboot C:\windows
Once this is done, reboot and Windows will boot up into the GUI. I too was having the same issue until I read this article below;
http://technet.microsoft.com/en-us/library/dd349348(WS.10).aspx
Good Luck,
Joe
I used your first version of this to get me started. From this, I’ve got where you guys are now. I currently have my images joining to the domain and here’s how I did it.
1. Under OOBESYSTEM: Instead of doing more than one command, do a script that completes all the task.
C:\windows\system32\sysprep\joindomain.cmd
Joindomain.cmd is:
# START FILE
@ECHO OFF
powershell -command “& Set-ExecutionPolicy Unrestricted”
powershell -command “& “‘C:\windows\system32\sysprep\joinDomain.ps1′”
cscript //b c:\windows\system32\slmgr.vbs /ato
powershell -command “& Set-ExecutionPolicy Restricted”
# END FILE
joinDomain.ps1 is:
#START FILE
# Setup a PSCred
$credential = New-Object System.Management.Automation.PsCredential(“”, (ConvertTo-SecureString (get-content C:\Windows\System32\sysprep\joindomain.key) -key (1..16)))
# Add computer to domain and use the PSCred as a username and password.
Add-Computer -DomainName “” -Credential $credential
# Delete 64 bit sysprep file.
If (test-path C:\Windows\System32\Sysprep\7_enterprise_x64_sysprep.xml)
{
rm C:\Windows\System32\Sysprep\7_enterprise_x64_sysprep.xml
}
# Delete 32 bit sysprep file.
If (test-path C:\Windows\System32\Sysprep\7_enterprise_x32_sysprep.xml)
{
rm C:\Windows\System32\Sysprep\7_enterprise_x32_sysprep.xml
}
# Delete the Key file.
If (test-path C:\Windows\System32\sysprep\joindomain.key)
{
rm C:\Windows\System32\sysprep\joindomain.key
}
# Remove the script launcher for sysprep.
If (test-path C:\Windows\System32\sysprep\joindomain.cmd)
{
rm C:\Windows\System32\sysprep\joindomain.cmd
}
# Delete my script once it’s finished
If (test-path C:\Windows\System32\sysprep\joindomain.ps1)
{
rm C:\Windows\System32\sysprep\joindomain.ps1
}
# Restart the computer.
restart-computer
# END FILE
The section about how to use PSCRED to secure your password from clear text can be found here:
http://ss64.com/ps/convertto-securestring.html
I hope this is something you guys can use.
Brian, My Hero,
on Step# 12, how can I add more scripts? is there a way to rename computer by device serial number?
Jonathon Vickers,
First of I like to thank Brian for posting sysprep on Windows 7, this is GREAT! Jonathon, I’m kind of new on scripting, could you please tell me I’m I supposed to enter something on “”? for example:
$credential = New-Object System.Management.Automation.PsCredential(“”, (ConvertTo-SecureString (get-content C:\Windows\System32\sysprep\joindomain.key) -key (1..16)))
what I’m I supposed to enter here, my credential? Does it needs to be Local Administrator or any credential? Please help! Greatly appreciated!
I have couple issues:
1) The issue I’m encoutering is getting my windows to activate, it keep saying “a problem occured when windows tried to activate. error code 0xc004f074″. Part of my problem is my network required authentication to websense before I can get out on internet.
2) I can’t get this thing to join domain…I followed every single steps above and no matter what I changed it still will not take it. I think Brian did a great job, I’m just not comp savy.
Thanks!
Dharm