共用方式為


Sysprep Command-Line Options

Applies To: Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2

Run Sysprep to prepare a Windows installation to be captured. This topic describes the command-line syntax for the Windows® 8 version of the System Preparation (Sysprep) tool.

If you intend to create an image of an installation for deployment to a different computer, you must run the Sysprep command together with the /generalize option, even if the other computer has the same hardware configuration. The Sysprep /generalize command removes unique information from your Windows installation so that you can safely reuse that image on a different computer. The next time that you boot the Windows image, the specialize configuration pass runs.

Sysprep Command-Line Options

The following command-line options are available for Sysprep:

Sysprep.exe [/oobe | /audit]

[/generalize]

[/mode:vm]

[/reboot | /shutdown | /quit]

[/quiet]

[/unattend:<answerfile>]

The following table lists Sysprep command-line options:

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 you send the installation to an end user. For example:

Sysprep /audit

If you specify an answer file, the audit mode of Windows Setup runs the auditSystem and auditUser configuration passes.

/generalize

Prepares the Windows installation to be imaged. Sysprep removes all unique system information from the Windows installation. Sysprep resets the security ID (SID), clears any system restore points, and deletes event logs. For example:

Sysprep /generalize /shutdown

The next time that the computer starts, the specialize configuration pass runs. The configuration pass creates a new security ID (SID).

/oobe

Restarts the computer into OOBE mode. For example:

Sysprep /generalize /shutdown /oobe

OOBE enables end users to customize their Windows operating system, create user accounts, name the computer, and perform other tasks. Sysprep processes any settings in the oobeSystem configuration pass in an answer file before OOBE starts.

/mode:vm

New for Windows® 8. Generalizes a Virtual Hard Disk (VHD) so that you can deploy the VHD as a VHD on the same Virtual Machine (VM) or hypervisor. After the VM restarts, the VM can boot to OOBE. For example:

Sysprep /generalize /oobe /mode:vm

The only additional switches that apply to VM mode are /reboot, /shutdown, and /quit.You must deploy the VHD on a Virtual Machine (VM) or hypervisor with the same hardware profile. For example, if you created VHD in Microsoft Hyper-V, you can only deploy your VHD to Microsoft Hyper-V VMs with a matching hardware profile. Deploying the VHD to a different VM with a different hardware profile might cause unexpected issues.

Important
You can only run VM mode from inside a VM..

/reboot

Restarts the computer. You can 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. You can use this option if you automate the Sysprep tool.

/quit

Closes the Sysprep tool without rebooting or shutting down the computer after Sysprep runs the specified commands.

/unattend:<answerfile>

Applies settings in an answer file to Windows during an unattended installation, where <answerfile> specifies the path and file name of the answer file to use. For example:

Sysprep /audit /reboot /unattend:F:\Unattend.xml

where F is the drive letter of the portable storage device on which the answer file (Unattend.xml) is located.

Important

You must use the Sysprep /generalize command to generalize a complete Windows installation before you can use the installation for deployment to a new computer, whether you use imaging, hard disk duplication, or another method. Moving or copying a Windows image to a different computer without running the Sysprep /generalize command is not supported.

See Also

Tasks

Sysprep (Generalize) a Windows installation

Reference

Use Answer Files with Sysprep

Concepts

Sysprep Process Overview
Sysprep Support for Server Roles

Other Resources

Sysprep (System Preparation) Overview