On Error resume next
Dim vol_prod_key
If wscript. Arguments. Count <1 then
Vol_prod_key = inputbox ("usage instructions:" & vbcr &"ProgramThe serial number of your current windows will be automatically replaced, and the full genuine version will be verified by Microsoft. "& Vbcr &" serial number (invalid for OEM, XP vlk by default): "& vbcr &" Enter the serial number (XP vlk by default ):", "Windows XP/2003 Serial Number replacement tool", "dg8fv-B9TKY-FRT9J-6CRCC-XPQ4G ")
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 "your windows CD-key has been modified successfully. Check System Properties. "
End if
If err <> 0 then
Wscript. Echo "modification failed! Check whether the entered CD-key matches the current Windows version. "
Err. Clear
End if
Next