Partager via


Sysprep Command-Line Syntax

Applies To: Windows 7

Note

This content applies to Windows® 7. For Windows® 8 content, see Windows Deployment with the Windows ADK.

Run Sysprep to prepare a Windows installation to be captured as a Windows image, including automatically booting to audit mode or OOBE (Out-of-Box Experience). This topic describes the command-line syntax for the Windows 7 version of the System Preparation (Sysprep) tool.

Important

If you intend to transfer a Windows image to a different computer, you must run the sysprep command with the /generalize option, even if the computer has the same hardware configuration. The sysprep/generalize command removes unique information from your Windows installation, which enables you to reuse that image on different computers.
The next time you boot the Windows image, the specialize configuration pass runs. During this configuration pass, many components have actions that must be processed when you boot a Windows image on a new computer.
Any method of moving a Windows image to a new computer, either through imaging, hard disk duplication, or other method, must be prepared with the sysprep /generalize command. Moving or copying a Windows image to a different computer without running the sysprep /generalize command is not supported.

Sysprep Command-Line Options

The following command-line options are available for Sysprep:

sysprep.exe [/oobe | /audit] [/generalize] [/reboot | /shutdown | /quit] [/quiet] [**/unattend:**answerfile]

Option Description

/audit

Restarts the computer into audit mode. Audit mode enables you to add additional drivers or applications to Windows. You can also test an installation of Windows before it is sent to an end user.

If an unattended Windows setup file is specified, the audit mode of Windows Setup runs the auditSystem and auditUser configuration passes.

/generalize

Prepares the Windows installation to be imaged. If this option is specified, all unique system information is removed from the Windows installation. The security ID (SID) resets, any system restore points are cleared, and event logs are deleted.

The next time the computer starts, the specialize configuration pass runs. A new security ID (SID) is created, and the clock for Windows activation resets, if the clock has not already been reset three times.

/oobe

Restarts the computer into Windows Welcome mode. Windows Welcome enables end users to customize their Windows operating system, create user accounts, name the computer, and other tasks. Any settings in the oobeSystem configuration pass in an answer file are processed immediately before Windows Welcome starts.

/reboot

Restarts the computer. Use this option to audit the computer and to verify that the first-run experience operates correctly.

/shutdown

Shuts down the computer after the sysprep command finishes running.

/quiet

Runs the Sysprep tool without displaying on-screen confirmation messages. Use this option if you automate the Sysprep tool.

/quit

Closes the Sysprep tool after running the specified commands.

/unattend:answerfile

Applies settings in an answer file to Windows during unattended installation.

answerfile

Specifies the path and file name of the answer file to use.

See Also

Concepts

Sysprep Windows 7
How Sysprep Works