Microsoft KB Archive/918342

= How to change the Volume Licensing product key on a Windows XP-based or a Windows Server 2003-based computer =

Article ID: 918342

Article Last Modified on 12/11/2007

-

APPLIES TO


 * Microsoft Windows XP Professional
 * 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

-





Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry

Warning The steps in this article only apply to Volume License media. If you follow these steps on OEM media or on retail media, you will not change the product key.



INTRODUCTION
When you use a leaked product key in a Volume Licensing installation to install Microsoft Windows XP or Microsoft Windows Server 2003 on multiple computers, various issues may occur.

Note A leaked product key is a product key that is available to the general public.

For example, you may not be able to install Windows service packs or to automatically obtain updates from the Windows Update Web site. You may experience the symptoms that are described in the following Microsoft Knowledge Base articles when you install a Windows service pack:

326904 You receive a &quot;The product key used to install Windows is invalid&quot; error message

883254 You receive a &quot;The product key used to install Microsoft Windows may not be valid&quot; error message when you try to install Windows XP Service Pack 2

842196 &quot;The product key used to install Microsoft Windows may not be valid&quot; error message when you try to install a Windows update in Windows Server 2003

This article describes how to change the Windows XP or Windows Server 2003 Volume Licensing product key after a Volume Licensing installation. For this procedure, you can use the Windows Activation Wizard graphical user interface (GUI) or a Windows Management Instrumentation (WMI) script. The Activation Wizard method may be easier. However, you may prefer the script method if you must change the product key for multiple computers.



Use the Activation Wizard
Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

If you do not have to change many Volume Licensing product keys, you can use the Activation Wizard.

Note We recommend that you run System Restore on Windows XP to create a new restore point before you follow these steps. For information about how to create a restore point by using System Restore, see the &quot;To Create a Restore Point&quot; help topic in Help and Support.  Click Start, click Run, type regedit, and then click OK. In the left pane, locate and then click the following registry subkey:

HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\Current Version\WPAEvents

 In the right pane, right-click OOBETimer, and then click Modify. Change at least one digit of the OOBETimer value to deactivate Windows. Click Start, click Run, type the following command, and then click OK:

%systemroot%\system32\oobe\msoobe.exe /a

 Click Yes, I want to telephone a customer service representative to activate Windows, and then click Next.</li> Click Change Product key, type the new product key in the New key boxes, and then click Update.

Note If the previous Activation Wizard screen appears again, click Remind me later, and then restart the computer.</li> Repeat steps 6 and 7 to verify that Windows is started. Click OK when you receive the following message:

Windows is already activated. Click OK to exit.

</li> Install any Windows service packs that you want to install.

Note If you cannot restart Windows after you install a service pack, press F8 when you restart the computer, click Last Known Good Configuration, and then repeat this procedure.</li></ol>

Use a script
You can create a WMI script that changes the Volume Licensing product key, and then deploy this script in a startup script. The ChangeVLKey2600.vbs and ChangeVLKeySP1 sample scripts use the new Volume Licensing key that you want to use, in a five-part alphanumeric form, as a single argument. We recommend that you use the ChangeVLKey2600.vbs script on Windows XP-based computers that are not running Service Pack 1 (SP1) or a later service pack. We also recommend that you use the ChangeVLKeySP1.vbs script on Windows XP-based computers that are running SP1 or a later service pack. These scripts perform the following functions:
 * They remove the hyphen characters (-) from the five-part alphanumeric product key.
 * They create an instance of the win32_WindowsProductActivation class.
 * They call the SetProductKey method with the new Volume Licensing product key.

You can create a batch file or a file that uses either of the following sample scripts together with the new product key as an argument. Then, you can deploy that file as part of a startup script or you can run the file from the command line to change the product key on a single computer.

For more information about how to script the product key, visit the following Microsoft Web site:

http://technet.microsoft.com/en-us/library/bb457096.aspx

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 &quot;Script can't run without VolumeProductKey argument&quot; Wscript.echo &quot;Correct usage: Cscript ChangeVLKey.vbs ABCDE-FGHIJ-KLMNO-PRSTU-WYQZX&quot; Wscript.quit end if

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

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

result = Obj.SetProductKey (VOL_PROD_KEY)

if err <> 0 then WScript.Echo Err.Description, &quot;0x&quot; & 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 &quot;Script can't run without VolumeProductKey argument&quot; Wscript.echo &quot;Correct usage: Cscript ChangeVLKey.vbs ABCDE-FGHIJ-KLMNO-PRSTU-WYQZX&quot; Wscript.quit end if

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

result = Obj.SetProductKey (VOL_PROD_KEY)

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

Next You can use the ChangeVLKeySP1.vbs script from a command line by performing the following action:

Click Start, click Run type the following command, and then click OK:

c:\changevlkeysp1.vbs

Note In this command,  is a placeholder that represents the new product key.

Additional query words: pid WMI ProductID license scripting piracy block blocking legal invalid product key sp1 install

Keywords: kbmsccsearch kbpubtypekc kbsetup kbregistry kbenv kbhowto KB918342

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.