Sysprep Command-Line Options
Run Sysprep to prepare a Windows installation to be captured. This topic describes the command-line syntax for 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.
Moving or copying a Windows image to a different computer without running the
Sysprep /generalize command is not supported.
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.
Sysprep.exe [/oobe | /audit] [/generalize] [/mode:vm] [/reboot | /shutdown | /quit] [/quiet] [/unattend:<answerfile>]
The following command-line options are available for Sysprep:
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.
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).
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.
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
/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.
You can only run VM mode from inside a VM.
Restarts the computer. You can use this option to audit the computer and to verify that the first-run experience operates correctly.
Shuts down the computer after the Sysprep command finishes running.
Runs the Sysprep tool without displaying on-screen confirmation messages. You can use this option if you automate the Sysprep tool.
Closes the Sysprep tool without rebooting or shutting down the computer after Sysprep runs the specified commands.
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
F is the drive letter of the portable storage device on which the answer file (Unattend.xml) is located.