There are two methods that people can apply to change the Product Key with the Volume Licensing media after installation. The first method is to use the graphical interface (GUI) Windows Activation Wizard, and the second method is to use commands in Windows Management Instrumentation (WMI).
The method of using Windows Activation Wizard is simpler than using the command line. Use this method in case you only have a few computers that need to change the Product Key. But in case you need to change the Product Key for multiple computers, the command method is the most effective method.
Use Windows Activation Wizard
Note: Before performing the following operations, you need to create a restore point in System Restore in case there is a problem with the system.
You do the following:
- Click Start | Run .
- In the Open box, type Regedit and then click OK .
- Then the Registry Editor window will appear. In the left panel, go to the following key:
HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsNTCurrent VersionWPAEvents - In the right panel, right-click OOBETimer and select Modify .
- Change at least some of this value to deactivate Windows.
- Click on the Start menu | Run .
- In the Open box, enter the following command and click OK :
% systemroot% system32oobemsoobe.exe / a - Click on Yes, I want to phone a customer service representative to activate Windows and then click Next .
- Click Change Product Key .
- Enter the new Product Key in the New key boxes and click Update . If you return to the previous window, click Remind me later and then restart the system.
- Repeat steps 6 and 7 to reactivate Windows. When you successfully activate, you will receive the message Windows is already activated . Click OK to exit the wizard.
- Click OK .
- Install SP1 for Windows XP.
You can create a WMI script to change the VLK, then deploy this script in a startup script. The sample ChangeVLKey2600.vbs script and ChangeVLKeySP1.vbs script described in this section will use a new VLK that you want to import. Microsoft recommends using the ChangeVLKey2600.vbs script for non-SP1 Windows XP computers and using the ChangeVLKeySP1.vbs script on computers that use the SP1 version of Windows XP. These two scripts perform the following functions:
- Delete the dash character (-) from the 5-part Product Key string.
- Create a win32_WindowsProductActivation class. They will call the SetProductKey function with the new VLK.
The ChangeVLKeySP1.vbs file contains the following code:
The ChangeVLKey2600.vbs script has the following code:
WMI Script - ChangeVLKey.vbs
Script này thay đổi được khóa product trên máy tính
************************************************** *************************
[netshelter] ON ERROR RESUME NEXT
if Wscript.arguments.count
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
For example, to use the ChangeVLKeySP1 script from the command line, go to the Start menu and enter the following command in the Run box and click OK:
WMI Script - ChangeVLKey.vbs
Script này thay đổi được khóa product trên máy tính
************************************************** *************************
ON ERROR RESUME NEXT
if Wscript.arguments.count
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 "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWPAEventsOOBETimer" '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
c: changevlkeysp1.vbs ab123-123ab-ab123-123ab-ab123In which AB123-123AB-AB123-123AB-AB123 is the new Product Key to use.