文章編號: 918342 - 上次校閱: 2006年8月14日 - 版次: 2.5

如何變更 Windows XP 或 Windows Server 2003 電腦上的 Volume Licensing (大量授權) 產品金鑰

系統提示本文適用於您使用的作業系統之外的作業系統。與您不相關的文章內容已停用。
重要 本文包含有關修改登錄的相關資訊。修改登錄之前,請務必備份登錄,並瞭解如何在發生問題時還原登錄。如需有關如何備份、還原和修改登錄的詳細資訊,請按一下下面的文件編號,檢視「Microsoft 知識庫」中的文件:
256986? (http://support.microsoft.com/kb/256986/ ) Microsoft Windows 登錄說明


警告 本文的步驟只適用於大量授權媒體。如果您在 OEM 媒體或零售版媒體上執行這些步驟,將不會變更產品金鑰。

在此頁中

全部展開 | 全部摺疊

簡介

當您在 Volume Licensing (大量授權) 安裝中使用 Leaked 產品金鑰在多部電腦上安裝 Microsoft Windows XP 或 Microsoft Windows Server 2003 時,可能會發生不同的問題。

注意Leaked 產品金鑰是一般大眾可使用的產品金鑰。

例如,您可能無法從 Windows Update 網站安裝 Windows Service Pack 或自動取得更新。當您安裝 Windows Service Pack 時,可能會遇到下列「Microsoft 知識庫」文件中說明的徵狀:

326904? (http://support.microsoft.com/kb/326904/ ) 您收到「用來安裝 Windows 的產品金鑰不正確」錯誤訊息
883254? (http://support.microsoft.com/kb/883254/ ) 安裝 Windows XP Service Pack 2 時收到「用來安裝 Microsoft Windows 的產品金鑰可能不正確」錯誤訊息
842196? (http://support.microsoft.com/kb/842196/ ) 嘗試在 Windows Server 2003 中安裝 Windows Update 時,收到「用來安裝 Microsoft Windows 的產品金鑰可能不正確」錯誤訊息
本文將告訴您在安裝 Volume Licensing (大量授權) 之後,如何變更 Windows XP 或 Windows Server 2003 Volume Licensing (大量授權) 產品金鑰。針對這個程序,您可以使用「Windows 啟用精靈」圖形化使用者介面 (GUI) 或 Windows Management Instrumentation (WMI) 指令碼。「啟用精靈」的方法可能會簡單一點。不過,如果您必須變更多部電腦的產品金鑰,可能會想用指令碼方法。

其他相關資訊

使用啟用精靈

警告 如果您使用「登錄編輯程式」或其他方法不當地修改登錄,可能會發生嚴重問題。您可能需要重新安裝作業系統,才能解決這些問題。Microsoft 不保證可以解決這些問題。請自行承擔修改登錄的一切風險。

如果您不需變更多個 Volume Licensing (大量授權) 產品金鑰,可以使用「啟用精靈」。

注意 Microsoft 建議您在依照下列步驟執行之前,先在 Windows XP 上執行「系統還原」以建立新的還原點。如需有關如何使用「系統還原」建立還原點的詳細資訊,請參閱「說明及支援中心」中的「建立還原點」說明主題。
  1. 按一下 [開始],再按一下 [執行],然後輸入 regedit,再按一下 [確定]
  2. 在左邊窗格中,找出並按一下下列登錄子機碼:
    HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\Current Version\WPAEvents
  3. 在右邊窗格中,用滑鼠右鍵按一下 [OOBETimer],然後按一下 [修改]
  4. 至少變更 OOBETimer 數值的其中一個數字,來停用 Windows。
  5. 按一下 [開始],再按一下 [執行],輸入下列命令,然後按一下 [確定]
    %systemroot%\system32\oobe\msoobe.exe /a
  6. 按一下 [是,我想要打電話給客戶服務代表來啟用 Windows],再按 [下一步]
  7. 按一下 [變更產品金鑰]、在 [新金鑰] 方塊中輸入新的產品金鑰,再按一下 [更新]

    注意 如果前一個「啟用精靈」畫面再次出現,按一下 [以後提醒我],然後重新啟動電腦。
  8. 重複執行步驟 6 和 7,以確認是否已啟動 Windows。當您收到下列訊息時,按一下 [確定]
    Windows 已經啟用。按一下 [確定] 結束。
  9. 安裝任何想安裝的 Windows Service Pack。

    注意 如果您在安裝 Service Pack 之後,無法重新啟動 Windows,請在重新啟動電腦時按下 F8,選取 [上次的良好設定],然後再重複這個程序。

使用指令碼

您可以建立變更 Volume Licensing (大量授權) 產品金鑰的 WMI 指令碼,然後再將此指令碼部署到啟動指令碼中。ChangeVLKey2600.vbs 及 ChangeVLKeySP1 範例指令碼會以五個部分的英數字元格式,使用您想使用的新 Volume Licensing (大量授權) 金鑰,做為單一引數。建議您使用未執行 Service Pack 1 (SP1) 或更新 Service Pack 之 Windows XP 電腦上的 ChangeVLKey2600.vbs 指令碼。同時建議您使用執行 SP1 或更新 Service Pack 之 Windows XP 電腦上的 ChangeVLKeySP1.vbs 指令碼。這些指令碼會執行下列功能:
  • 指令碼會移除五部分英數字元產品金鑰的連字號字元 (-)。
  • 指令碼會建立 win32_WindowsProductActivation 類別的例項。
  • 指令碼會以新的 Volume Licensing (大量授權) 產品金鑰呼叫 SetProductKey 方法。
您可以建立使用下列範例指令碼搭配新產品金鑰的批次檔或檔案,做為引數。然後將檔案部署為啟動指令碼的部分,或可從命令列執行檔案,變更單一電腦上的產品金鑰。

如需有關如何撰寫產品金鑰指令碼的詳細資訊,請造訪下列 Microsoft 網站:
http://www.microsoft.com/technet/prodtechnol/winxppro/deploy/wpadepl.mspx (http://www.microsoft.com/technet/prodtechnol/winxppro/deploy/wpadepl.mspx)

ChangeVLKeySP1.vbs

' 
' WMI Script - ChangeVLKey.vbs
'
' This script changes the product key on the computer.
'
'***************************************************************************

ON ERROR RESUME NEXT


if Wscript.arguments.count<1 then
   Wscript.echo "Script can't run without VolumeProductKey argument"
   Wscript.echo "Correct usage: Cscript ChangeVLKey.vbs ABCDE-FGHIJ-KLMNO-PRSTU-WYQZX"
   Wscript.quit
end if

Dim VOL_PROD_KEY
VOL_PROD_KEY = Wscript.arguments.Item(0)
VOL_PROD_KEY = Replace(VOL_PROD_KEY,"-","") 'remove hyphens if any

for each Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_WindowsProductActivation")

   result = Obj.SetProductKey (VOL_PROD_KEY)

   if err <> 0 then
      WScript.Echo Err.Description, "0x" & Hex(Err.Number)
      Err.Clear
   end if

Next

ChangeVLKey2600.vbs

' 
' WMI Script - ChangeVLKey.vbs
'
' This script changes the product key on the computer.
'
'***************************************************************************

ON ERROR RESUME NEXT

if Wscript.arguments.count<1 then
   Wscript.echo "Script can't run without VolumeProductKey argument"
   Wscript.echo "Correct usage: Cscript ChangeVLKey.vbs ABCDE-FGHIJ-KLMNO-PRSTU-WYQZX"
   Wscript.quit
end if

Dim VOL_PROD_KEY
VOL_PROD_KEY = Wscript.arguments.Item(0)
VOL_PROD_KEY = Replace(VOL_PROD_KEY,"-","") 'remove hyphens if any
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegDelete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WPAEvents\OOBETimer" 'delete OOBETimer registry value
for each Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_WindowsProductActivation")

   result = Obj.SetProductKey (VOL_PROD_KEY)

   if err <> 0 then
      WScript.Echo Err.Description, "0x" & Hex(Err.Number)
      Err.Clear
   end if

Next 
您可以執行下列動作,從命令列使用 ChangeVLKeySP1.vbs 指令碼:

按一下 [開始],再按一下 [執行],輸入下列命令,然後按一下 [確定]
c:\changevlkeysp1.vbs ab123-123ab-ab123-123ab-ab123
注意 在此命令中,ab123-123ab-ab123-123ab-ab123 是代表新產品金鑰的預留位置。

這篇文章中的資訊適用於:
  • Microsoft Windows XP Professional
  • Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
  • Microsoft Windows Server 2003, Datacenter x64 Edition
  • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
  • Microsoft Windows Server 2003, Enterprise x64 Edition
  • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
  • Microsoft Windows Server 2003, Web Edition
  • Microsoft Windows Server 2003 R2 Enterprise Edition (32-Bit x86)
  • Microsoft Windows Server 2003 R2 Enterprise x64 Edition
  • Microsoft Windows Server 2003 R2 Standard Edition (32-bit x86)
  • Microsoft Windows Server 2003 R2 Standard x64 Edition
關鍵字:?
kbsetup kbregistry kbenv kbhowto KB918342
Microsoft及(或)其供應商不就任何在本伺服器上發表的文字資料及其相關圖表資訊的恰當性作任何承諾。所有文字資料及其相關圖表均以「現狀」供應,不負任何擔保責任。Microsoft及(或)其供應商謹此聲明,不負任何對與此資訊有關之擔保責任,包括關於適售性、適用於某一特定用途、權利或不侵權的明示或默示擔保責任。Microsoft及(或)其供應商無論如何不對因或與使用本伺服器上資訊或與資訊的實行有關而引起的契約、過失或其他侵權行為之訴訟中的特別的、間接的、衍生性的損害或任何因使用而喪失所導致的之損害、資料或利潤負任何責任。