本文適用於
Microsoft Windows XP Professional
Microsoft Windows XP Professional SP
本文是用於描述如何更改Windows XP中的序列號
使用激活向導修改
微軟強烈建議你在修改之前作一個系統還原點
如果退回到前一個畫面
如果你安裝SP
使用腳本
以下有
下面是用於已經安裝了SP
ON ERROR RESUME NEXT
if Wunt<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
下面的腳本是用於沒有安裝SP1的WinXP(ChangeVLKey2600.vbs)。tW.WIngwIT.cOM
'
' WMI Script - ChangeVLKey2600.vbs
'
' This script changes the product key on the computer
'
'***************************************************************************
ON ERROR RESUME NEXT
if Wunt<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
例子:腳本使用方法
以下的例子描述了在命令行裡面如何使用VBS腳本程序。
1.點擊[開始],然後點擊[運行];
2.輸入C:\ChangeVLKeySp1.vbs ABCDE-ABCDE-ABCDE-ABCDE-ABCDE-ABCDE
假設 ChangeVLKeySp1.vbs 放在C:根目錄下
ABCDE-ABCDE-ABCDE-ABCDE-ABCDE-ABCDE 是新的序列號
以上 ChangeVLKeySp1.vbs 適用於已經安裝了SP1的WinXP,沒有安裝SP1的 ChangeVLKey2600.vbs 的使用方法同樣是這樣的。
3.然後點擊[確定]即可。
From:http://tw.wingwit.com/Article/os/xtgl/201311/9173.html