PDA

View Full Version : Thay đổi Microsoft Windows XP Key bằng VBS


pacific_boy571
22-07-2006, 07:41 PM
Đây là hai đoạn mã dùng để thay đổi Microsoft Windows XP Key. Tôi muốn đưa lên để các bạn tham khảo.

Nếu bạn dùng Windows XP sp1 thì dùng đoạn mã sau:
'
' 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

Đoạn mã dưới đây dùng cho Windows XP sp2

'
' 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

pacific_boy571
22-07-2006, 07:48 PM
Cách thực thi những file này như sau :


1. Click Start --->> Run.
2. In the Open box, type the following command, where AB123-123AB-AB123-123AB-AB123 is the new product key that you want to use, and then click OK:
c:\changevlkeysp1.vbs TRINH-DUCAN-HTHEU-CE270-81986

pacific_boy571
22-07-2006, 07:52 PM
Cách chạy các File trên như sau :


1. Click Start, and then click Run.
2. In the Open box, type the following command, where AB123-123AB-AB123-123AB-AB123 is the new product key that you want to use, and then click OK:
c:\changevlkeysp1.vbs TRUON-GTHPT-CHUYEN-LAMSO-NTK70

hoangha
31-10-2006, 09:16 PM
Cách chạy các File trên như sau :


1. Click Start, and then click Run.
2. In the Open box, type the following command, where AB123-123AB-AB123-123AB-AB123 is the new product key that you want to use, and then click OK:
c:\changevlkeysp1.vbs TRUON-GTHPT-CHUYEN-LAMSO-NTK70
ông thay đổi cái này làm cái quái gi?