Académique Documents
Professionnel Documents
Culture Documents
aspx
Sysprep Executable
Sysprep Processes
Using an Answer File with Sysprep
Resetting Windows Activation
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 their tasks, and then either shuts down the system, restarts the system,
or exits Sysprep.
To apply the settings in auditSystem and auditUser, you must boot to Audit mode by using the sysprep/audit
command.
To apply the settings in the generalize pass, you must generalize the Windows image by using the
sysprep/generalize command.
For more information, see How Configuration Passes Work. For more information about Sysprep command-line options,
see Sysprep Command-Line Syntax.
1 of 5 20/05/2016 17:32
How Sysprep Works https://technet.microsoft.com/en-us/library/cc766514(v=ws.10).aspx
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 Sysprep, 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.
If there are RunSynchronous commands in the answer file in the auditUser configuration pass, a list of the commands are
displayed in the AudiUI window in the order specified by RunSynchronous/RunSynchronousCommand/Order. Each list
item in the UI is either the string from:
All RunSynchronous commands are processed in order. If the command succeeds, then its related list item is annotated
with a green checkmark. If the command fails, then its related list item is annotated with a redX. If a reboot is requested,
the AuditUI is redisplayed after the boot but only unprocessed list items are displayed. Previously processed items no
longer appear in the AuditUI. If the list of items in the AuditUI exceeds the height of the display, then the list is clipped to
the display and does not scroll. As a result, some items might not be visible.
Windows Setup interprets the zero and nonzero return codes as status values in the AuditUI. A zero value indicates a
success, while a nonzero value indicates a failure. The return value of the command might affect the behavior of the
Setup, depending on the value of the RunSynchronous/RunSynchronousCommand/WillReboot command.
If the command returns 0, its related list item is annotated with a green checkmark. A reboot immediately occurs.
If the command returns nonzero, its related list item is annotated with a redX. A reboot immediately occurs.
If the command returns 0, its related list item is annotated with a green checkmark.
If the command returns nonzero, its related list item is annotated with a redX. A nonzero return value is not
treated as a fatal error when WillReboot is set either to Always or Never.
2 of 5 20/05/2016 17:32
How Sysprep Works https://technet.microsoft.com/en-us/library/cc766514(v=ws.10).aspx
If the command returns0, its related list item is annotated with a green check mark.
If the command returns1, its related list item is annotated with a green check mark. A reboot immediately occurs.
If the command returns2, its related list item is temporarily annotated with a green checkmark. A reboot
immediately occurs. Following the reboot, the related list item is displayed again in the AuditUI without annotation
because the command is still in process.
If the command returns other values, then a fatal error occurs and a blocking dialog is displayed. If the
Errorhandler.cmd file is present, no dialog is displayed. For more information about Errorhandler.cmd, see Add a
Custom Script to Windows Setup.
There is no limit to the number of times Sysprep can run on a computer. However, the clock for Windows Product
Activation begins its countdown the first time Windows starts. You can use the sysprep /generalize command to reset
Windows Product Activation a maximum of three times. After the third time you run the sysprep /generalize command,
the clock can no longer be reset.
When you run the sysprep /generalize command, the activation clock will automatically reset. You can bypass resetting
the activation clock by using the SkipRearm setting in the Microsoft-Windows-Security-Licensing-SLC component. This
enables you to run Sysprep multiple times without resetting the activation clock. For more information about this setting,
see the Unattended Windows Setup Reference.
Important
If you anticipate running Sysprep multiple times on a single computer, you must use the SkipRearm setting in the
Microsoft-Windows-Security-Licensing-SLC component to postpone resetting the activation clock. Because you can
reset the activation clock only three times, if you run Sysprep multiple times on a computer, you might run out of
activation clock resets. Microsoft recommends that you use the SkipRearm setting if you plan on running Sysprep
multiple times on a computer.
Activation can be reset an unlimited number of times for an activated Key Management Service (KMS) clients. For
non-activated KMS clients, the activation clock can be reset only up to three times, the same as a single license.
Microsoft recommends that KMS clients use the sysprep /generalize command where the value of the SkipRearm
setting is equal to1. After capturing this image, use the sysprep /generalize command where the value of the
SkipRearm setting is equal to0.
For Multiple Activation Keys (MAK) clients, the recommendation is to install the MAK immediately before running
Sysprep the last time before delivering the computer to a customer.
For OEM Activation licenses, activation is not required. OEM Activation is available only to royalty OEMs.
To activate Windows for your customer, use the unique Product Key from the certificate of authenticity (COA) label that is
affixed to the specific computer, and activate the computer on behalf of the end user. Run the sysprep /oobe command
3 of 5 20/05/2016 17:32
How Sysprep Works https://technet.microsoft.com/en-us/library/cc766514(v=ws.10).aspx
Note
You cannot make an image of an activated Windows installation and duplicate that image to another computer. If you
do, Windows fails to recognize the activation and forces the end user to reactivate the installation manually.
Windows Welcome Windows Welcome, also called Machine OOBE (out-of-box experience), is the first user
experience and enables end users to customize their Windows installation. End users can create user accounts,
read and accept the Microsoft Software License Terms, and choose their language and time zones.
By default, all Windows installations boot to Windows Welcome first.
The oobeSystem configuration pass runs immediately before Windows Welcome starts. For more information
about this configuration pass, see oobeSystem.
Audit Mode. Audit mode enables OEMs and corporations to add customizations to their Windows images. Audit
mode does not require settings in Windows Welcome to be applied. By bypassing Windows Welcome, you can
access the desktop quicker and perform your customizations. You can add additional device drivers, install
applications, and test the validity of the installation.
In Audit mode, settings in an unattended answer file in the auditSystem and auditUser configuration passes are
processed. For more information about these configuration passes, see auditSystem and auditUser.
If you are running in Audit mode, to configure the installation to boot to Windows Welcome, run the sysprep
/oobe command. OEMs are required to run sysprep /oobe before shipping a computer to an end user. In a
default Windows Vista installation, after installation completes, Windows Welcome starts. However, you can skip
Windows Welcome and boot directly to Audit mode by pressing Ctrl+Shift+F3 at the first Windows Welcome
screen.
For unattended installation, you can configure Windows to boot to Audit mode by using the Microsoft-Windows-
Deployment | Reseal setting in an answer file. For more information, see the Unattended Windows Setup
Reference.
For more information about Audit mode, see Customize Windows in Audit Mode.
generalize %WINDIR%\System32\Sysprep\Panther
specialize %WINDIR%\Panther\
4 of 5 20/05/2016 17:32
How Sysprep Works https://technet.microsoft.com/en-us/library/cc766514(v=ws.10).aspx
See Also
Concepts
What is Sysprep?
Sysprep Command-Line Syntax
Community Additions
2016 Microsoft
5 of 5 20/05/2016 17:32