'***************************************************************************
'
' Windows XP Key Changer v1.0
' This script changes the product key on Windows XP SP1, SP2 and SP3
'
'***************************************************************************

ON ERROR RESUME NEXT

Dim VOL_PROD_KEY
if Wscript.arguments.count<1 then
VOL_PROD_KEY = InputBox ("This script will change the product key of:"&vbCr&"Windows XP SP1, SP2 and SP3."&vbCr&vbCr&"Please input the correct CD-Key in the blank field below:","Windows XP Key Changer")
if VOL_PROD_KEY = "" then
Wscript.quit
end if
else
VOL_PROD_KEY = Wscript.arguments.Item(0)
end if

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 "Windows XP Product Key was changed successfuly."
   end if

   if err <> 0 then
      Wscript.echo "Error entering new product key: "&VOL_PROD_KEY&""&vbCr&vbCr&"Please verify that this Product Key was entered correctly or is a valid key."
      Err.Clear
   end if

Next
