How Sysprep Works

Only available on StudyMode
  • Download(s) : 63
  • Published : May 6, 2013
Open Document
Text Preview
Published: October 22, 2009 Updated: July 8, 2010 Applies To: Windows 7 Note This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK. The System Preparation tool, Sysprep.exe, is used to prepare an installation of Windows® for imaging or delivery to a customer. This topic includes: Sysprep Executable Sysprep Process Using Answer Files with Sysprep Resetting Windows Activation Booting to Audit Mode or Windows Welcome Detecting the State of a Windows Image Sysprep Log Files

Sysprep Executable
Sysprep.exe is the main program that calls other executable files that prepare the Windows installation. Sysprep.exe is located in the %WINDIR%\system32\sysprep directory on all installations. Sysprep must always be run from the %WINDIR%\system32\sysprep directory and must run on the version of Windows with which it was installed.

Sysprep Process
When Sysprep runs, it goes through the following process: 1. Verifies that Sysprep can run. Only an administrator can run Sysprep, and only one instance of Sysprep can run at a given time. Also, Sysprep must run on the version of Windows with which it was installed. 2. Initializes logging.

3. Parses command-line arguments. If no command-line arguments were provided, the Sysprep window appears that enables users to specify Sysprep actions. 4. Processes Sysprep actions, calls appropriate .dll files and executable files, and adds actions to the log file. 5. Verifies that all .dll files have processed all of their tasks, and then either shuts down or restarts the system.

Using Answer Files with Sysprep
You can use an answer file with Sysprep to configure unattended Setup settings. The following sections describe some of the considerations and processes for using answer files with Sysprep.

Applying Settings in the generalize, auditSystem, and auditUser Configuration Passes Not all configuration passes run during Windows Setup. Some configuration passes are available only when you run Sysprep. The generalize, auditSystem and auditUser configuration passes are available only by running Sysprep. If you add settings to your answer file in these configuration passes, you must run Sysprep to apply these settings: To apply the settings in the auditSystem and auditUser configuration passes, you must boot to audit mode by using the sysprep/audit command. To apply the settings in the generalize configuration pass, you must use the sysprep/generalize command. The generalize configuration pass removes the systemspecific settings, enabling you to deploy the same image for multiple computers. For more information, see How Configuration Passes Work. For more information about Sysprep command-line options, see Sysprep Command-Line Syntax.

Caching Answer Files to the Computer
If you install Windows by using an answer file, that answer file is cached to the system so when subsequent configuration passes run, settings in the answer file are applied to the system. Because this answer file is cached, when you run the Sysprep command, settings in the cached answer file are applied. If you use the settings in a different answer file, you can specify a separate Unattend.xml file by using the sysprep /unattend:filename option. For more information, see Sysprep Command-Line Syntax. For more information about using implicit answer file search, see How Windows Setup Works.

Persisting Plug and Play Device Drivers During generalize
You can persist device drivers when you run the sysprep command with the /generalize option by specifying the PersistAllDeviceInstalls setting in the Microsoft-Windows-PnPSysprep component. During the specialize configuration pass, Plug and Play scans the computer for devices and installs device drivers for the detected devices. By default, these device drivers are removed from the system when you generalize the system. If you set PersistAllDeviceInstalls to true in an answer file, Sysprep will not remove the detected device...
tracking img