Implement the code to replace the Windows XP serial number with the VBS script _vbs
Source: Internet
Author: User
On ERROR RESUME NEXT
Dim Vol_prod_key
If Wscript.arguments.count<1 Then
Vol_prod_key =inputbox ("Use instructions:" &vbCr&vbCr& "This program will automatically replace your current serial number of Windows, verified by Microsoft completely genuine." "&vbCr&vbCr&" Serial Number (invalid OEM version, default version is XP VLK): "& vbcr&vbcr&" Enter serial number (default is XP VLK): "," 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. Please check the System properties. "
End If
If Err <> 0 Then
WScript.Echo "Modification failed!" Please check that the cd-key you entered matches the current version of Windows. "
Err.Clear
End If
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.