如何使用sysprep unattend.xml激活Windows 7?

如何使用unattend.xml文件通过SysPrep激活通过映像部署的Windows 7?

这是我迄今写的代码:

<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <settings pass="generalize"> <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls> </component> </settings> <settings pass="specialize"> <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <RunSynchronous> <RunSynchronousCommand wcm:action="add"> <Description>Disable create user account</Description> <Path>reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\OOBE /v UnattendCreatedUser /t REG_DWORD /d 1 /f</Path> <Order>1</Order> </RunSynchronousCommand> </RunSynchronous> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <RegisteredOwner>NetLiteracy</RegisteredOwner> <RegisteredOrganization>NetLiteracy</RegisteredOrganization> <TimeZone>Eastern Standard Time</TimeZone> <ProductKey>**ValidProductKey**</ProductKey> <Computername>*</Computername> <OOBE> <HideEULAPage>true</HideEULAPage> <NetworkLocation>Other</NetworkLocation> <ProtectYourPC>2</ProtectYourPC> <SkipUserOOBE>true</SkipUserOOBE> </OOBE> </component> </settings> <settings pass="oobeSystem"> <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <InputLocale>en-US</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> </settings> </unattend> 

这听起来好像是直接编辑答案文件的XML – 我强烈build议您安装Windows自动安装工具包(可从Microsoft获得),并使用其中的Windows系统映像pipe理器工具编辑答案文件,使用更多用户友好的方法,根据Microsoft文档在这里 。

具体而言,您正在查找组件amd64_Microsoft-Windows-Shell-Setup_neutral的值ProductKey ,在专用阶段(阶段4)期间应在此实例中添加该值。