Skip to content

SysPrep in Depth - Part 5 - Customizing Sysprep.inf⚓︎

September 28, 2007

Customizing Sysprep.inf⚓︎

Understanding the sysprep.inf⚓︎

I am know there are other sections to the sysprep.inf then what I will use in this example but in my environment I only use these so I will stick to these. Many of these are also optional and many don’t seem to have an effect in my environment but I will still explain them to you. You can find more resources on the sysprep.inf parameters on the Microsoft KB article 298491 and on Microsoft’s Windows 2000 Deployment Guide.

I would suggest running setupmgr.exe in the sysprep folder to create a base sysprep.inf file and to then edit it by hand from then on as setupmgr.exe can delete some of your customizations.

Our sample sysprep.inf⚓︎

; ----------------- Sysprep Notes -----------------
; Note: All notes in this files must have a ';' before them, and the first line should not be changed from 'SetupMgrTag'
;Steps to using this file:
; 1: Run the file c:syspreputilsPNPPath.bat - this will set the OemPnPDriversPath below for syspreps use
; 2: Verify if you need a new HAL and add appropriate UpdateUPHAL or UpdateHAL lines below under the [unattended] section
; 3: Verify the admin password in the [GuiUnattended] section
;        If done properly this file is deleted after sysprep completes so this should not be a security issue

Driversintel" DriverSigningPolicy=Ignore InstallFilesPath=C:\sysprep\i386 TargetPath=WINDOWS KeepPageFile=0 OemSkipEULA=Yes UpdateInstalledDrivers=Yes NonDriverSigningPolicy=Ignore UpdateServerProfileDirectory=1


AdminPassword="0h S0 S3cure"
OEMDuplicatorstring="Demo Clone"


FullName="Your Name"
OrgName="Your Organization"




[RegionalSettings] LanguageGroup=13,17,3,2,5,16,4,12,15,7,8,10,11,9,6,14,1 Language=00000409

[Networking] InstallDefaultComponents=Yes

[Identification] JoinWorkgroup=TEMPORARY

[GuiRunOnce] Command0=c:\drivers\scripts\cleanup.bat

...Shortand for this post...

Section by Section⚓︎


Section Comment
OemPnPDriversPath=… We talked about this in Part 1 of this series
DrvierSigningPolicy=Ignore This will let SysPrep silently install drivers that are not signed
InstallFilesPath=c:\sysprep\i386 This should be the location of the i386 folder from the Windows XP CD
TargetPath=Windows The folder name to install windows to Keep
PageFile=0 Deletes the page file to help make sure no residual from the other hardware is still hanging around
OEMSkipEULA=Yes Accepts the EULA for you automatically
UpdateInstalledDrviers=Yes Reinstalls any drivers that have updates to them
NonDriversSigningPolicy=Ignore Ignores warnings about unsigned files that are not drivers
UpdateServerProfileDirectory=1 More Info The article talks about this setting with a hotfix and SP2, but in this hotfix seems to be included in SP3. This setting takes the administrator profile and copies it to the default profile.


Section Comment
BuildMassStorageSection=Yes Extremely important as this will build all mass storage drivers


Section Comment
AdminPassword=… Set this to your password
EncrypedAdminPassword=NO I always opt out of encrypting the admin password as I have had times this step fails and encrypting the password disables the autologon feature use further down
OEMSkipRegional=1 Skips the Regional options page
OEMDuplicatorString=”Clones Name” This is a key put into the registry so you can track what clone a computer came from
TimeZone=10 10 just happens to MST so you will need to change this to your time zone
OEMSkipWelcome=1 Skips the Welcome Screen
AutoLogon=Yes Logs the administrator into the computer automatically after sysprep finishes
AutoLogonCount=3 Will log the administrator on for 3 reboots. Note that if you log off the PC it will log you right back on until you restart


Section Comment
Title1=”” This is to add a favorite to IE automatically but it has yet to work for me. Change the number for each new site
URL1= The URL to match Title1


Section Comment
FullName=”Your Name” The name in which the computer is registered to
OrgName=”Your OrgName” The organization in which the computer is registered to
ComputerName=* Let sysprep pick a random computer name
ProductKey= Put your volume license key in here, if you do not have one leave this value blank. Look for another post from me shortly to get around typing in the key on every computer if you don’t have a VLK


Section Comment
BitsPerPel=32 32bit color
xResolution=1024 set the monitor to 1024x768
yResolution=764 set the monitor to 1024x768
vRefresh=72 72 Hz
AutoConfirm=1 Confirm the resolution change, if you don’t set this to 1 you will need to click ok within 15 seconds to keep the video settings once they change


Section Comment
CountryCode=1 1 is for the US, change this accordingly
Dialing=Tone Set the modem to tone dialing
AreaCode=719 Your area code LongDistanceAccess=”9” Set this to the number the computer will need to use to get an outside line


Section Comment
LanguageGroup=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 Installs all languages
Language=00000409 set the default to English


Section Comment
InstallDefaultComponents=Yes Installs all the default network protocols


Section Comment
JoinWorkgroup=Temp Joins the computer to a workgroup called Temp


Section Comment
Command0=c:\drivers\scripts\cleanup.bat Runs a program once the computer boots into windows. I will explain cleanup.bat in a little


This section is created automatically and contains a list of mass storage drivers.

Creating the Mass Storage Devices List⚓︎

SysPrep will need to know what type hard drive drivers to load during setup so you should always create you [SysprepMassStorage] section to help it out will all your drivers. The get this section filled in with all your values run sysprep.exe with the -bmsd switch.

Creating Cleanup.bat⚓︎

If you were paying attention to my sample sysprep.inf file you noticed a cleanup.bat file that would be run on login once the computer was finished syspreping. This is optional but I always delete the drivers folder off the root of the hard drive. To accomplish this with ease download movefile.exe from Microsoft and place it in a ‘scripts’ folder within the drivers folder along with a new batch file called cleanup.bat

Edit this cleanup.bat file and add the following to it:

@echo off
title Clone Process - Cleaning Files
echo Cleaning unneeded drivers from sysprep process.
cd /d c:\
cd c:\drivers\scripts\
movefile.exe c:\drivers "" 1>nul 2>nul
rmdir /s /q c:\drivers 2>nul
del /s /q /f c:\drivers 2>nul

This will start a little command window on login that will delete as many drivers as it can and then proceed to delete any it couldn’t delete on the next restart. The plug and play section of SysPrep should have installed all the drivers you need from this folder so there is very little use for this folder now.


Glenn Deans, 01/21/2008

If you are trying to include SCSI or SATA drivers, it is better to run sysprep -bmsd rather than use the BuildMassStorageSection=Yes line. Both methods build the generic mass storage controller entries, but the SysprepMassStorage section entries for any custom SCSI or SATA drivers that you add must be present before you run sysprep or the driver information will not be included and your drivers will never load (BSOD 7B). It’s not something you can do on the fly in one step.

David Remy, 01/23/2008

Looking through all my documentation I can’t figure out how I missed this. All my batch and inf files don’t use the -bmsd switch but you are right. I am guessing since we don’t build on and SCSI or SATA devices I never scripted this.

Glenn has a great point, the BuildMassStorageSection=Yes is not nearly as important as the -bmsd switch.

Thanks Glenn, glad to see what I have is semi useful to others and yet still has room to grow.

Rob D., 01/30/2008

In the section:

[GuiUnattended] AdminPassword=… Set this to your password

Only use this if the password for the admin account is already blank. Otherwise it will fail to change it or set it. I learned this lesson after examining my logs files after running sysprep. I just set it on the initial install of WinXP, then leave it out of the sysprep.inf file.

The log files for WinXP sysprep/setup are: setuplog.txt - Contains information about setup actions during the installation.

setuperr.txt - Contains information about setup errors during the installation.

setupapi.log – Contains information about hardware detection during the installation

Those log explanations are from the BDD 2007 WinXP FAQ:

Keep up the good work on your sysprep series, I’m sure plenty of people will find it useful.

David Remy, 01/30/2008

Interesting, I don’t think I have ever noticed this but I might have disregarded it if I did run into it.

Thanks for adding the info on the log files, it’s always nice to know where to look for errors when something does go wrong.

Rob D., 01/30/2008

One more thing I learned today about sysprep and the DriverSigningPolicy=Ignore entry, if you run mini-setup, it won’t load the driver until you log in the first time. DriverSigningPolicy=Ignore only works with the -PNP switch, which makes mini-setup take longer. For those of us supporting Dell GX270s for example, the latest 865G video driver is unsigned. So either use an older signed driver, or sysprep -pnp, or load the driver interactively at first boot. Great, just great!

It’s covered here:

David Remy, 01/30/2008

How wonderful…

Yet again, thanks for the great input!

Glenn Deans, 02/05/2008

For those of you that use the MachineObjectOU under the Identification section, if the computer account is already present in the domain (if you re-image an existing system) this line will be ignored in favor of where the account already resides. Not sure, but I believe sysprep lacks the functionality to move an AD object but does pass this as amplifying info when it joins a domain and would be creating the initial AD object. Drove me nuts for a while.

Glenn Deans, 02/05/2008

Opps, hadn’t read the addendum you posted. MachineObjectOU was already covered. Sorry about that. ;)

David Remy, 04/16/2008

Looking back it seems I might have posted about some legacy functions of sysprep.inf. I believe that FavoritesEX is no longer used and can be omitted, can anyone confirm this?

Nat, 04/18/2008


Great site, I have been referring to it often as I typically make most of the recovery images for our company. I did notice, however, that you have KeepPageFile=0 and according to Microsoft 0 will regenerate the page file and 1 will not regenerate it. I will be testing it today =)

Andrew Pagano, 05/23/2008

I would like to echo the applause given by some of the previous people replying to these documents, very good job. I find that taking this info in with info provided in has been quite helpful.My question is with regards to the “ComputerName=*” portion of you INF. I have been using a program called MySysPrep which allows one to name the machine via some info found in the SMBios. Do you know if SysPrep allows me to do the same thing? The entry I use in MySysPrep is “ComputerName=XXXXX-%SerialNo%”.

Oh, check out the MySysPrep page too (just google it); it is very straight forward and a quick read. You may find it useful.

Again thanks for all your hard work!, 07/02/2008, (edited 10/07/2018)

[…] have been changes to sysprep in XP SP3. I have updated my pages to reflect this but the issue deals with the default profile and it no longer being copied when […]

Cobus, 08/26/2008

After having read this it might actually solve some of my problems with Sysprep. One issue still biting me is the display section. Running a primary analog screen extended to a secondary digital screen. After Sysprep have run the extended screen is disabled and need to be manually enabled again. Due to some lockdown functions on our devices that creates more problems than it seems. Can any one assist me with why this happens or how to solve it.

Dylan, 10/17/2008

With building the mass [SysprepMassStorage] section using sysprep -bmsd, how do I tell it to look in my c:driversscsi directory for the inf and driver files? I looked in the inf, and found the ID for the controller I need, but when I looked through the sysprep.inf file, that ID isn’t listed.

David Remy, 10/29/2008

Hi Dylan,

The [SysprepMassStorage] section will only include drivers for devices that are in the computer where -bmsd is run from. If you run sysprep -bmsd on a system without the scsi device it will not include the driver, even if the inf and sys files are in the right places. Try running sysprep -bmsd on a computer with the scsi device installed and then just copy the lines from that sysprep.inf to your master sysprep.inf.

Ron, 11/07/2008


I am trying to sysprep a winxp sp3 image from a Dell optiplex GX620, has sata hard drive, integrated audio/video. System I’m cloning the drive to is a Dell Precision 390 which has a scsi/SAS hard drive via pcie card. I am getting a BSOD on bootup with the STOP error 0x7B. Research tells me it has to do with the SAS hard drive. Here’s the thing with sysprep, I’ve copied the I386 folder off a dell winxp sp2 cd into sysprep and am using InstallFilesPath=C:sysprepi386 under the [unattended] section. I’ve also tried using the chipset and sas drivers from dell, extracted these with 7-zip and tried to follow your drivers folder setup with OemPnPDriversPath but honestly I am completely confused as to how to set it up, don’t think I did it right. I can’t see why this clone won’t work, especially if I can boot the Precision 390 off the green dell winxp restore cd no problem- that tells me all the drivers are there doesn’t it at least to get the machine to boot and run, and then I see a few devices without drivers in device manager and that’s when I go to the dell chipset & audio & network drivers and everything’s 100%. Any advice on how to get the drive on the gx620 sysprep’d and not get the stop error upon boot on the precision390?

Joe B, 01/14/2009

Ron, in order for your SAS drive to get detected and load correctly BEFORE sysprep starts [remember that you need to have critical device db entries already included in your image prior to sysprep running, or else sysprep won’t be able to access the HDD].When you run sysprep and reseal your image, make sure that your sysprep.inf includes an entry in your [SysprepMassStorage] section.

For instance here’s an entry from mine for an Adaptec 2-port SATA raid controller:

pciven_1095&dev_0240 = c:sysprepc1210sawin32aarsi3x.inf, c:sysprepc1210sawin32, "Adaptec Embedded Serial ATA HostRAID Driver Windows 2000/XP/2003", c:sysprepc1210sahraidsk1

Make sure that is all one continuous line from pci…tohraidsk1

this info matches the following syntax:

%FullPlug&playHardwareID% = %pathtodriverfolder%%drivername%.inf, %pathtodriverfolder%, "%Disk Name% (found in the corresponding INF), %DiskIDFile%

Erich, 03/03/2009

Nice Info.

One minor issue I’ve run into regards comments in sysprep.inf. According to MS’s syntax rules for INFs

Any characters following a semicolon on the same line, unless the semicolon appears within a “quoted string” or %strkey% token [have no relevance].

That is a bit strange since the OemPnPDriversPath line is often full of them. I suppose you can put the string with the semicolons in quotes, but I never have and don’t have problems. I have found at least one page with explicit comments (this one is good: also.)

The problem I ran into is that I can’t seem to have comments at the end of a line. Lines like:

ComputerName=”*” ; creates a random computer name. and AdminPassword=”” ; prompt for admin password.

brought up the computer name and admin password prompt with the text fields full of the comment text! Other lines with comments seemed to do wacky things too.

I’m willing to admit that I’m an ignorant fool, but I have NOT been able to find any confirmation that INFs in general can’t have comments at the end of lines OR that sysprep.inf is not-your-usual-kind-of-INF.

Would you please flag me as ignorant or cleaver as the case may be?


David Remy, 03/04/2009


I guess I am ignorant or cleaver as well. I have noticed this same issue with inf’s being malformed but I have never seen issues with it. I haven’t tried doing comments like you mentioned with the ComputerName and AdminPassword keys but it’s interesting to think it does create issues when used in that manner on that key.

Thanks for that great little tidbit, I totally forgot about the ; not being proper formatting.

Steve, 03/09/2009

Does anyone know of a script (possibly to work with sysprep.inf) that will reassign the original client hostname (NetBIOS name) via resolving the client assigned IP address against DHCP or a WINS server?

Let’s say I have 50 client PCs and I re-image them using a ghostcast server (Note: Using “Configuration Refresh” works but not preferred as who wants to purchase ghost client licenses for over 1,000 PCs) Post imaging generic hostnames were generated via sysprep.inf. I want to retain their previous hostnames that are registered with a WINS server or assigned to IP address in DHCP.

It would be cool to have a script that generated and ran a second sysprep.inf file (post generic hostname assignment) on the client that would input the assigned NetBIOS name from WINS or DHCP based upon client IP address.

Any thoughts?

Max, 04/01/2009

Few observations regarding SCSI/SAS/AHCI HD controllers…Given: Source -> image (XP SP3) that was created on IDE or SATA emulation set to IDE machine. (DC7600/7700/7100) Target -> SATA emulation set to AHCI machine (DC7900)

In my view there is no point running sysprep.exe with -bmsd switch or state BuildMassStorageSection=YES in sysprep. It just makes the whole sysprep procedure longer and doesn’t contribute anything to the result since drivers for for newer HD controllers are not active on source machine and have to be added to the Sysprep.inf manually anyway.

Below is a portion of sysprep.inf that has been proven to make XP SP3 image built on HP DC 7100/7600/7700 work on HP DC7900 (AHCI)



I believe only 2 lines from the above (3A02) are really needed for the DC7900, but we left the rest just in case HP in its infinite wisdom decides to switch HD controller in the future.

Scott, 06/12/2009

Also this is good, if anyone didn’t know,


Notice that the above command is UpdateUPHAL (UP for Uniprocessor) and that the HAL selected ends in UP. The reason for doing this is when going from Uniprocessor->Multiprocessor, the Multiprocessor HAL will ALWAYS be used, regardless of whether the Uniprocessor one is appropriate. Microsoft says there is a “serious” performance hit for using the Multiprocessor HAL on a machine that should use the Uniprocessor HAL - this is why it makes sense to start out with the Multiprocessor HAL base machine (like we do) and check for UP first rather than going the other way. swyda_techblog, 11/16/2009 […] As always I found more info to add on to a previous post… To find the original post with much more info then this post please look at this post: SysPrep Part 5 […]

Haziel, 01/18/2010

Hi there,

is there any way to put variables in the file for the computername? I want our computers all named like “whvws##” where ## stands for numbers from 01 up to 40

Shane, 07/01/2010

Haziel… you asked…”is there any way to put variables in the file for the computername?”

“I want our computers all named like “whvws##” where ## stands for numbers from 01 up to 40”

With standard sysprep and sysprep.inf I do not think there is a way to do variables.

However, it is possible to at least prefix the ComputerName with your prefix (“whvws”). Refer to

What you can do… is use a registry file like below… and import it just before you run sysprep.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion]

And in your sysprep.inf you still have your normal entries for FullName=”xyz” and OrgName=”xyz”

David, 01/21/2010

I use oempnpdrivers and sysprepmassstorage in my sysprep.inf. Here is what I found. When I run sysprep and if it took longer time (10-15 minutes) then I can use the image to deploy it to other models. I have SATA and IDE machines. But if it took only a few minutes then it will BSOD with stop x7b on a different disk type. For example, reference machine is SATA got stop x7b on IDE even before mini setup. And sysprep always takes just a few minutes on a machine where sysprep has been run before. Maybe I should clean up anything left out by prvious sysprep before re-run. But how? I ran sysprep -reseal -mini -q -pnp.


Quad, 01/21/2010

I have a image that works on all computers but the GX 620 Built on a VM Machine with XP SP 2.

I get the Hal switching via scripts and user the driver packs and drive pack scanner with ROE.exe 937 and It has the bmsd before I sysprep

But it keeps black screening on the Dell GX 520 and GX 620, they dectect the hal correctly. one is a uni the 520 and the gx 620 are muti they have Pentium D for duel cores but they boot great with everything in safe mode but won’t boot to windows.

I have tired everything disabled intelppm (this is a amd fix for images windows recovery fix boot.ini fixbmr chckdsk ect

I can’t get these models to boot whats the secret they have all of the drivers installed but won’t boot correctly + after I sysprep I tell the machine to show the blue screen error but it won’t let me turn it on in Safe Mode, HOW DO I FIX THIS?

Quad, 01/21/2010

BTW here is how to fix the hal issues Put in your sysprep command file Make a txt file in your C:sysprepi386$oem$ I call it Cmdlines.txt In the Cmdlines.txt put this info below

[COMMANDS] “C:lngHal_Update.bat”

I put the Hal_Update.bat in a folder called Ing you can put it anywhere just make sure you link it correctly, this will run during mini setup and fix any hal issue you are having. I have the script here.

Here is the script (I have named this script below Hal_update.bat) Copy and paste it into a text file and rename it and save as (Make sure you don’t save it as a text file as a .bat)

@echo off


devcon.exe /find @ROOTACPI_HAL000 | find /i "Multiprocessor" > NUL && SET HAL=ACPIAPIC_UP
devcon.exe /find @ROOTPCI_HAL000 | find /i "Multiprocessor" > NUL && SET HAL=MPS_UP
) ELSE (
devcon.exe /find @ROOTACPI_HAL000 | find /i "Uniprocessor" > NUL && SET HAL=ACPIAPIC_MP
devcon.exe /find @ROOTPCI_HAL000 | find /i "Uniprocessor" > NUL && SET HAL=MPS_MP

IF NOT "%HAL%"=="" (
ECHO ----------------------------------------
ECHO Installing %HAL% HAL
ECHO ----------------------------------------

devcon.exe sethwid @ROOTPCI_HAL000 := +%HAL%
devcon.exe sethwid @ROOTACPI_HAL000 := +%HAL%
devcon.exe update %windir%infhal.inf %HAL%
devcon.exe ReScan

ECHO ----------------------------------------
ECHO Rebooting
ECHO ----------------------------------------
devcon.exe Reboot
) ELSE (
ECHO ----------------------------------------
ECHO Correct HAL Detected
ECHO ----------------------------------------


Quad, 01/21/2010

Here is my bat file that I have run sysprep I use driver packs to get my drivers

Run to sysprep

@echo off

echo Enabling image for AMD and Intel processors
reg add "HKLMSYSTEMControlSet001Servicesintelppm" /v Start /t REG_DWORD /d 4 /f

echo Running sysprep and shutting down.
sysprep.exe -forceshutdown -mini -reseal -quiet -activated

Just copy and paste this to a text file and name it sysprep.bat put it in your sysprep folder and click it to sysprep

Jordan, 04/16/2010

I’m having an issue getting the drivers to install on my target computer. I’ve posted to the microsoft technet site but nobody has been able to give me any sort of response. This is the post, I hope someone has some ideas or can point me in the right direction. I can’t post the text from my sysprep.inf here but if you click on this link you should be able to see it.

R Rice, 04/21/2010

SOS!!! I love this blog, it has helped me out a lot in trying to make sense of Sysprep but I am having the same problem Jordan. I even have the same HALs (ACPI Multiprocessor PC) on source and target computers. Source computer is a Dell GX520 and the target is a Dell Optiplex 755. Here are the steps I have taken roughly:

  1. Extracted device drivers for the target PC using DriverMax
  2. Copied the i386 folder from the XP CD to the Sysprep folder on source computer
  3. Ran Setupmgr.exe from Sysprep folder
  4. Made a folder named Drivers on the C: of source computer and added the drivers from the target computer in it.
  5. Used Vernalex’s driver scanner software to add the drivers to the registry
  6. Used the cacls command to make sure the permissions for the Sysprep folder and driver folder are good.
  7. Made changes to the Sysprep.inf file to add

  8. Used the Sysprep -bmsd command to populate the Sysprep.inf file

  9. Ran the Sysprep.exe. Chose: Mini-setup, Detect Non-Plug and Play, Reseal with Shutdown.
  10. Then cloned the source computer with Clonezilla and imaged the target computer and keep getting the BSOD with the 7B error.

Please help. I have read and re-read this blog and others but cannot figure out what is going on!!!

Thank you.

R Rice, 04/21/2010

I have a another question. After I prep the source computer and image it and re-start it…it goes through the install process and looks like it is installing drivers and asks for a licensing key. Is that normal? This is a computer which had all the drivers and licensing key etc.

Thank you so much for your help.

R Rice, 04/28/2010

Okay, I found my answer. Maybe this will help someone. I booted the source computer in the legacy mode, then when it booted I went in to safe mode. It gave me an error saying XP cannot work in safemode so I rebooted and this time when I choose safe mode it was fine. At this point it started the Windows set-up but had no mouse or keyboard. OUCH! So with some more research I found these lines to add to the sysprep.inf file to force the mouse and keyboard drivers to load.


Also for good measure I added the lines below so incase the ones above don’t work, it would bypass the screens it needs input and try to load the needed drivers. Don’t know which section helped but I think I would use both just in case.

OemSkipEula = Yes

OemSkipWelcome = 1
OemSkipRegional = 1

Also, for me the most important part was to set the boot to Legacy mode on the target computer otherwise I wasn’t even getting to pick the safe mode to proceed. I imaged and re-imaged it a few times, believe me this was crucial. I finally successfully imaged a Dell Optiplex 755 from a Dell GX520.

Hope this helps.

R Rice, 04/28/2010

Sorry above I meant the target computer in legacy mode NOT source computer.