Imaging Windows Machines with Sysprep
Microsoft supplies a set of deployment tools for system administrators, to help make their lives a little easier. In particular, they provide us with a handy little program called SysPrep; it allows us to prepare any system (hence the name) for deployment onto any other machine. So instead of having to update 70 images (or, more likely, letting 70 images get incredibly out of date), you only need to deal with one.
So what is it?
As mentioned before, Sysprep lets us use a single image for multiple different machines. Essentially, it re-runs the installation process. So while it certainly cuts down on time spent updating multiple images, the actual deployment takes longer, probably an extra fifteen to twenty minutes. The image itself is also larger than normal, because it’s including all the drivers needed for the machines you manage.
Initially setting up Sysprep can be quite troublesome (I’ve spent a number of months finding many different ways that Sysprep doesn’t work), but once you’ve got an image working properlly, you only need to keep the one updated. Compared to the alternative, it’s incredibly efficient.
This method of Sysprepping a machine is probably not “proper”, but it works well, and is pretty simple.
Gathering necessary components
We’ll be using a couple different programs to get the image setup for sysprepping:
-Sysprep (duh). Microsoft has a set of deployment tools, among them being Sysprep. Note that the link provide is for SP3. If for some reason you need SP2 or earlier, just Google it.
-Sysprep Driver Scanner. Provided by VernAlex.com, this free program scans your Drivers folder, and sets up the Registry properly, so Sysprep can find them.
Besides those, you also need to get the drivers for all the machines you plan on using this imaging. This is probably the most tedious, time consuming part of the process. Save them somewhere like C:\Drivers\, or C:\Sysprep\Drivers\ if you want them to be removed once Sysprep is finished.
Organization is important. Some people break their folders into different driver types (Video, chipset, audio, etc). Personally, I broke mine down into different model series (Latitude D6 Series, Precision 300 series, etc). I chose this for two reasons: I want to easily see what model machines my image currently supports, and I wanted to cut down on redundant drivers. The idea here is that similar model machines probably share some components, so why have the drivers twice? I also created a “Common” folder, for drivers shared by different series machines. Using a freeware program called WinMerge, you can easily compare the contents of two folders, and find files that they both share.
Chances are, the drivers will come in executables. You can, in most cases, extract these using something like 7-zip, or your preferred archiving program. If you run into any floppy disk images (SATA drivers seem to come as them), you can mount these with a virtual floppy drive. It works a lot like a virtual CD drive would; you can mount the disk images and grab the drivers that way.
Configuring Sysprep
So once all that is prepared, we need to configure Sysprep. If you haven’t already, download Sysprep from Microsoft; it comes as a file named deploy.cab. Extract its contents to C:\Sysprep. We’re interested in two programs: setupmgr and sysprep.
Open up Setupmgr. This program allows us to configure most of the options you would normally choose during installation. Once you’re past the Welcome screen, select Create New. The next screen gives us three options: Unattended, Sysprep, and Remote Installation Services. Choose Sysprep Setup for now. On the following screen, choose the Windows product you’re sysprepping. And finally, you’re given a choice between automating the installation or not. Once you’re more comfortable, you can probably automate the setup, but for now, select No, do not fully automate the installation. That window will close, revealing a larger window behind it, titled Setup Manager.

Use the Setup Manager to configure Sysprep.inf
This is pretty self-explanatory; you just step through each category, filling out the information as needed (much like during Windows installation). Here I must note: if you don’t have a site license for Windows XP, leave the license key blank, otherwise it will attempt to use the same key for every installation. Once this is finished, it will save the configuration to C:\Sysprep\Sysprep.inf. Once you’ve completed this, click Cancel (I know, it’s a problem that Microsoft hasn’t fixed).
We need to make one addition to Sysprep.inf; we need to tell it to build a list of Mass Storage Devices. Open it up, and add:
[Sysprep] BuildMassStorageSection=yes [SysprepMassStorage]
at the end. Sysprep builds a list of Mass Storage (ie harddrive) drivers to load when the computer restarts. Without this, it’s likely that the image won’t load properly on other machines.
Configuring Sysprep Driver Scanner
Next, we need to prepare the list of drivers. We could do this ourselves, by adding a OemPnPDriversPath= section, but that would be painfully tedious. One of the major drawbacks of Sysprep is that it doesn’t search beyond the initial directories you point it to for drivers; we can’t just point it at C:\Drivers, and expect to search through all subfolders. So you either have to point it to a lot of different folders, or lump them all in one. Either way, it’s messy.
Instead of having to manually add every folder to Sysprep.inf or to the Registry, Sysprep Driver Scanner takes care of all of that for us. We just need to point it at the folders we want, and it searches them for drivers. This is a pretty simple 6-step process, as shown on the six buttons to the lefthand side.

Configuring Sysprep Driver Scanner
So click 1. Default, this will add the system driver path. Next, set the Search Path to the Driver folder we set up earlier, and click 2. Scan. This will populate the list with all the drivers it finds, and you should get a Success window. Step 3, we add C:\windows\inf and C:\winnt\inf manually to the list, as the program recommended. Step 4, highlight the drivers you don’t want added (for example, some of them are Windows 2000/98 drivers), and click 4. Remove. Again, you should get a Success window. Then click Save, and finally, Done.
Final Preparations
Before we can successfully Sysprep this machine, there are a few more things we need to change. We need to change both the HAL (hardware abstraction layer) and the Harddrive controllers to generic drivers, in order to ensure that the image will boot on (almost) any machine.
Both of these can be done through the Device Manager. Open it up (right click My Computer, click Manage, then select the Device Manager) and open the Computer section, as shown:

Selecting the Computer's HAL
This shows you the current HAL running on this machine. Right click on it, and select Update Driver. This opens the Hardware Update Wizard. Our goal is to set the HAL to Advanced Configuration and Power Interface (ACPI) PC, as it’s most likely to run on any hardware. So select No, not this time. On the next screen, select Install from a list or specific location. We can’t have Windows search for the driver itself, so next select Don’t Search. I will choose the driver to install. You should then see a list of available drivers:

Select Advanced Configuration and Power Interface (ACPI) PC
Select the HAL, and click Next. It will then install the new drivers and finish. Don’t restart, because we need to do the same for the IDE ATA/ATAPI Controllers. Here we want to change the controllers to the most generic possible. Expand that section, and if any of them don’t say something like Primary Channel, Secondary Channel, or anything with Standard in it, repeat the process above and choose something like Standard PCI IDE Channel. You may have to uncheck Show Compatible Hardware in order to get to it.

Select a Generic IDE Controller
Changing the HAL
The most important step is to make sure Sysprep will update the HAL correctly. As in the previous section, we’ve set the HAL to ACPI PC. This HAL will run on pretty much anything you cast it onto, but it doesn’t take advantage of multiple cores or hyper-threading, so it’s really not the best choice to run a machine on. VernAlex has a rather in-depth article about HALs, if you’re interested.
Although there are a number of different HALs out there for Windows, only a few are regularly used: Advanced Configuration and Power Interface (ACPI) PC, ACPI Uniprocessor PC, and ACPI Multiprocessor PC. If you’re running a relatively new Intel or AMD processor, you’re most likely using one of these three. You can check what HAL a machine runs by looking in the Device Manager.
Because Sysprep can’t figure it out on its own, we’ve got to help. So we need to change Sysprep.inf a bit before we run Reseal. It’s pretty simple, really. If the machine you’re imaging normally runs the ACPI PC HAL, you don’t need to change anything. If it runs the ACPI Multiprocessor PC, add UpdateUPHAL=”ACPI APIC_MP,%windir%\inf\hal.inf” under the [Unattended] section. And if it runs the Uniprocessor, add
UpdateUPHAL=”ACPI APIC_UP,%windir%\inf\hal.inf” instead.
If you’re looking at other Sysprep articles (which I’d recommend), you’ll probably notice that the UpdateHAL entry might be used differently. From what I’ve read, people seem to disagree on how and when UpdateHAL should be used versus UpdateUPHAL. The difference between the two is that one is used for Uniprocessor (hence the UP) and one is for Multiprocessor. But does that refer to the HAL currently installed, or the one you want to change to? From my personal experience, I use UpdateUPHAL whenever I’m changing from a uniprocessor HAL to something else, regardless if the new one is multiprocessor or not, and so far it seems to work fine. Ultimately, I don’t know who’s right or wrong (or if there is a right or wrong), but this works for me.
So anyway, changing this one line isn’t so bad, but what if you’ve got a lot of different machines? You could just keep a text file explaining what machine types use what HAL, but with a little work, this too could be automated. There’s a program called Mysysprep, a freeware program written by J. Tsay, that adds some customization options to Sysprep.
It works like this: Mysysprep runs before Sysprep, and checks things like the processor type, manufacturer, model name, serial number, and asset tag of your machine. It then compares these with values in a file called MySysprep.inf, and if any match, it inserts a section of code into Sysprep.inf.
Within MySysprep.inf, there are five sections: [CPU], [Manufacturer], [Model], [SerialNo], and[Asset Tag]. And within each section, you list possible values you want it to find, and the corresponding .inf file you want it to insert into Sysprep.inf. For instance, if you want to load specific settings for model name Precision Workstation 370, you would put:
[Model] Precision Workstation 370=Precision370.inf
and within Precision370.inf, you put the information you want inserted into Sysprep.inf. I’m not going to go into too much detail about this, because I only want to show you how to setup Mysysprep to handle changing the HAL. More information about Mysysprep in general can be found on its website.
You can see what MySysprep grabs from any machine’s bios by running MySysprep.exe /smbios from command line. You’ll then see a box pop up like this:

Machine information from MySysprep
Notice that the information matches up with the different sections of MySysprep.inf; everything but the CPU information is there. The CPU type can be found by running Mysysprep.exe /cpu :

CPU type, according to MySysprep
By default, MySysprep.inf comes with sample entries, commented out with semicolons. It also comes with two other inf files: MP.inf and UP.inf. These contain entries for changing the HAL, similar to what I’ve written earlier. In MySysprep.inf, remove the semicolon before the line GenuineIntel.MP=mp.inf, so any machine that is multiprocessor will use the multiprocessor HAL. However, I would not recommend doing the same for uniprocessor machines. For instance, MySysprep recognizes the CPU for my D800 as a GenuineIntel.UP, but it shouldn’t be running the ACPI UP HAL (in fact, I can’t even get it to boot with it), it should stay with the default ACPI PC.
Instead, use the Model name to differentiate between the different uniprocessor machines. If a machine needs to use the Uniprocesssor HAL, include it’s model under the [Model] section. And with this, we’ve coverd all of our bases; anything with a multiprocessor CPU will use the multiprocessor HAL, certain models listed under the [Model] section will use the uniprocessor, and everything else will just be left alone.
So once all that has been taken care of, launch MySysprep. Looks an awful lot like Sysprep, right? That’s because it’s really just a hacked version of Sysprep. You’ll first see a warning:

Click OK, and it will bring us to Sysprep’s main window. As you can see, there are three main choices: Factory, Audit, and Reseal. The Factory setting is used first, to install new drivers and configure the OS for the new computer. Once it’s setup, you use Reseal to clean out everything used by Sysprep (basically, it deletes C:\Sysprep, any registry information it leaves, and clears the Events Log). Audit mode is used to test the installation while in Factory mode.
So for now, choose Factory, and select Use Mini-Setup. Also, make sure the Shutdown mode is on Shut Down.

Select Factory Mode.
The first time you run Sysprep, it will probably take a while (I timed it at a little over 20 minutes). It has to build the Mass Storage section, which takes a surprisingly long time. As long as the little hour glass keeps going, your machine is still working. Once it’s finished, the machine shuts down. It’s then ready to be imaged for use on other machines.
Resealing
So you’ve taken an image of the machine, and cast it onto a new model. When you first boot it up, you should see the blue “Please wait while Windows prepares to start…” and then you’ll be taken back to your desktop, with Sysprep open again. Right now you’re still in Factory mode. If there are any changes that need to be made, make them. For instance, it would be right now that you change the UpdateUPHal settings.
If you’re using the MySysprep approach, close the Sysprep window and open MySysprep (otherwise just leave it). Check “Use Mini-Setup” and click Reseal.

Reseal the machine
Sysprep will do it’s thing, you’ll see the little hour glass spinning around again. Once it’s done, it’ll shut off. When you restart the computer, after seeing the “Please wait” screen again, you’ll get a Windows XP Setup window. If you’re running MySysprep, you should see a picture in the top-right corner that says “MySysprep”.
This works just like Windows Setup, except it pulls the information from Sysprep.inf. If you’ve filled out all the information, the setup process will be more or less automatic.
Once it finishes, the machine restarts, and takes you to the login screen. When you login, your machine will probably spend a while finding new hardware. Once it’s done, go to the Device Manager, and make sure that the HAL and harddrive controllers are correct. Also notice that the Sysprep folder is automatically deleted. If you have any now unneeded folders (like the drivers) you can delete those too.
After a couple restarts, make sure all the hardware is found correctly, and your computer is ready to be used.
Odds and Ends
This isn’t always a perfect process, and it might take a couple tries to get it right. I spent months practically beating my head against a wall, trying to figure out how on earth Sysprep works. This section is just a list of common problems I’ve run into, and how to alleviate them.
Sysprepped image gives you a Blue Screen of Death, or worse, doesn’t do anything
This is most likely a HAL issue. If you have your S ysprep Image set to Advanced Configuration and Power Interface (ACPI) PC, it will boot on most “normal” machines. It is possible that the machine you’re trying to Sysprep requires a very different HAL. You can find out what HAL is needed easily, by checking the Device Manager on a machine of the same model.
It could also be a problem with the harddrive controller. If, for instance, you’r moving from an IDE drive to SATA, you must make sure the controllers are set to the generic Standard controllers, otherwise it’ll never boot.
Computer won’t shut down properly/gets stuck at Logging Off
Again, this is probably a HAL issue. It’s possible that the computer is using the wrong HAL, but it’s also very likely that the HAL’s drivers just haven’t been properly loaded. Open Device Manager, right click the HAL, and select Update Driver. Let Windows automatically pick the best one. Restart (it might still get stuck), then try to shut down again. It should, ideally, shut down properly.
If it still doesn’t, its possible that you’re using the wrong HAL. Find out what the proper HAL is, then grab a program called HALu (HAL Updater). This program provides an easy way to manually change your HAL, without having to deal with changing drivers by hand.
Keyboard and Mouse don’t work after Resealing
If you built your original image on a laptop, trying to push it to a desktop can cause this problem. It’s because Windows doesn’t load new hardware until after it goes through the Setup routine, so things like USB keyboards and mice don’t work. One easy way around this is just to plug in a USB mouse and/or keyboard in to the laptop and make sure they work before taking the image.
Resources
Vernalex.com: Sysprep Guide
I found a lot of good information from here concerning HALs, as well as the Sysprep Driver Scanner program. The whole website in general has a lot of good information.
Answers that Work: How to Sysprep a Windows XP corporate PC setup (PDF)
This is a very straightforward how-to on Sysprepping a machine.
Microsoft TechNet: Choosing Sysprep Settings
A good article about the various settings in Sysprep and what they do.
Tsaysoft.com: MySysprep
This is really a wonderful tool to enhance the automation of Sysprep.









I appreciate your article. It was very helpful and lead me to others that were as helpful.
I just realized that after looking at your article several times that you are at UMSL. UniGroup is located south of you in Fenton. We are at the intersection of 270 and 44.
Would you mind if I drop you a note every once in a while to pick your brain? I am always wanting to learn more.
Dave Barger
[...] for something and you don’t mind sitting through the setup process, it works. Just like my article for XP, I want to say that I don’t know if the methods here are the “right” way to go [...]
[...] all the credit for Fog + Sysprep, but Michael Vowtaw has a really REALLY nice guide on the basics – COE Exchange: Imaging Windows Machines with Sysprep I use about 80% of his guide and 20% of my own configuration. I prefer to use driverpacks for my [...]
[...] get pointed in the right direction. Personally I suggest reading up on Michael Votaw's XP guide – COE Exchange: Imaging Windows Machines with Sysprep Mike does a good job with the basics, but I would take it one step further! =) #1. Use Sysprep [...]
[...] is a great guide for using driverpacks – COE Exchange: Imaging Windows Machines with Sysprep Decent guide too… I use about 90% of it and 10% of my own. Reply With Quote [...]