SysPrep in Depth - Part 5 - Customizing Sysprep.inf

Customizing Your Sysprep.inf For Use  (Last updated 5/15/08 ) - 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

;SetupMgrTag ; ----------------- 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 ; [Unattended] OemPnPDriversPath="Drivers11;Drivers110;Drivers111;Drivers112;Drivers113;Driversintel" DriverSigningPolicy=Ignore InstallFilesPath=C:\sysprep\i386 TargetPath=WINDOWS KeepPageFile=0 OemSkipEULA=Yes UpdateInstalledDrivers=Yes NonDriverSigningPolicy=Ignore UpdateServerProfileDirectory=1 [Sysprep] BuildMassStorageSection=Yes [GuiUnattended] AdminPassword="0h S0 S3cure" EncryptedAdminPassword=NO OEMSkipRegional=1 OEMDuplicatorstring="Demo Clone" TimeZone=10 OemSkipWelcome=1 AutoLogon=Yes AutoLogonCount=3 [FavoritesEx] Title1="Google.com" URL1="http://google.com" [UserData] FullName="Your Name" OrgName="Your Orginization" ComputerName=* ProductKey=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx [Display] BitsPerPel=32 Xresolution=1024 YResolution=768 Vrefresh=72 AutoConfirm=1 [TapiLocation] CountryCode=1 Dialing=Tone AreaCode=719 LongDistanceAccess="9" [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:driversscriptscleanup.bat [SysprepMassStorage] *pnp0a00=c:windowsinfmachine.inf *pnp0a01=c:windowsinfmachine.inf *pnp0a04=c:windowsinfmachine.inf *pnp0a03=c:windowsinfmachine.inf pcicc_0604=c:windowsinfmachine.inf pcicc_0601=c:windowsinfmachine.inf ...Shortand for this post... pciven_1055&dev_9130=c:windowsinfmshdc.inf pcmciamicron-mtcf____-392d=c:windowsinfmshdc.inf pciven_1179&dev_0105=c:windowsinfmshdc.inf - Section by Section

[Unattended] 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 KeepPageFile=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.

[Sysprep] BuildMassStorageSection=Yes     Extremely important as this will build all mass storage drivers

[GuiUnattended] 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

[FavoritesEX] Title1="Google.com"     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=http://google.com      The URL to match Title1

[UserData] 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

[Display] 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

[TapiLocation] 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

[RegionalSettings] 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

[Networking] InstallDefaultComponents=Yes       Installs all the default network protocols

[Identification] JoinWorkgroup=Temp     Joins the computer to a workgroup called Temp

[GuiRunOnce] Command0=c:driversscriptscleanup.bat      Runs a program once the computer boots into windows. I will explain cleanup.bat in a little

[SysprepMassStorage] 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 cls title Clone Process - Cleaning Files echo. 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.

Sorry this isn't easy to read but I don't want to spend too much time touching it up at this time.