下是一个无人值守应答文件(unattend.xml
)的示例,其中包含了跳过获取更新、驱动程序和可选功能,以及自动输入密钥的设置:
xml
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
</component>
</settings>
<settings pass="offlineServicing">
<!-- 在此处添加离线服务设置 -->
</settings>
<settings pass="generalize">
<!-- 在此处添加通用化设置 -->
</settings>
<settings pass="specialize">
<!-- 在此处添加特定化设置 -->
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<OOBE>
<HideEULAPage>true</HideEULAPage>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>1</ProtectYourPC>
<SkipMachineOOBE>true</SkipMachineOOBE>
<SkipUserOOBE>true</SkipUserOOBE>
</OOBE>
<UserAccounts>
<AdministratorPassword>
<Value>YourAdminPassword</Value>
<PlainText>true</PlainText>
</AdministratorPassword>
</UserAccounts>
</component>
</settings>
<upgrade>
<source>
<version>6.2</version> <!-- 这里指定 Windows Server 2012 的版本 -->
<edition>ServerStandard</edition> <!-- 指定要升级的 Windows Server 2012 版本,如 ServerStandard、ServerDatacenter 等 -->
</source>
</upgrade>
<ProductKey>YourProductKey</ProductKey> <!-- 在此处输入您的产品密钥 -->
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Path>reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v DisableOSUpgrade /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
</RunSynchronous>
</unattend>
请注意,您需要将 YourProductKey
替换为您实际的 Windows 产品密钥。
上述设置中的 RunSynchronous
部分通过修改注册表来实现跳过获取更新、驱动程序和可选功能的目的。