当无人值守文件中定义了 ProductKey 时,Windows7 仍然需要产品密钥

当无人值守文件中定义了 ProductKey 时,Windows7 仍然需要产品密钥

我正在尝试使用 Sysprep 和无人参与文件来构建系统映像。

主要目的是让最终用户选择自己的用户名和计算机名称,但阻止他们输入产品密钥并手动激活它。

这是我的 unattend.xml

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="generalize">
        <component name="Microsoft-Windows-Security-Licensing-SLC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SkipRearm>1</SkipRearm>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Path>net user administrator /active:yes</Path>
                    <Order>1</Order>
                </RunSynchronousCommand>
            </RunSynchronous>
        </component>
        <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SkipAutoActivation>false</SkipAutoActivation>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>en-US</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UserLocale>en-US</UserLocale>
        </component>
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ShowWindowsLive>false</ShowWindowsLive>
            <TimeZone>New Zealand Standard Time</TimeZone>
            <ProductKey>AAAA-BBBB-CCCC-DDDD-EEEE</ProductKey>
            <FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <CommandLine>cscript //b c:\windows\system32\slmgr.vbs /ato</CommandLine>
                    <Order>1</Order>
                </SynchronousCommand>
            </FirstLogonCommands>
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <NetworkLocation>Home</NetworkLocation>
                <ProtectYourPC>1</ProtectYourPC>
                <SkipMachineOOBE>false</SkipMachineOOBE>
                <SkipUserOOBE>false</SkipUserOOBE>
            </OOBE>
        </component>
    </settings>
</unattend>

我发出的 sysprep 命令:

sysprep /generalize /oobe /quit /unattend:unattend.xml

但是,当我将图像还原到计算机后,它仍然提示我输入产品密钥。我的 xml 文件有什么问题?


更新

此安装盘在安装过程中不需要产品密钥。我猜这就是该<ProductKey>线路无法工作的原因。但我仍然需要预先安装密钥而无需用户交互。如何实现?谢谢。

答案1

据我了解,将 Windows-Shell-Setup 组件添加到 specialize pass 并设置产品密钥。如果您希望自动激活,那么您可以尝试在 specialize pass 中运行 SynchronizedCommand,它将执行:cscript slmgr.vbs /ipk /atoi

或者简单地

cscript slmgr.vbs /atoi

使用产品密钥和激活 | Microsoft Docs

您还可以查看下面的链接是否有帮助。

Windows 10 sysprep - 如何跳过输入产品密钥 - 输入主机名 | 超级用户

相关内容