Advertisement
c00lkiddv2016

Legit Source

Jun 28th, 2017
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '***************************************************************************
  2. '
  3. ' Windows XP,Vista,7 CD-Key Changer v1.2
  4. ' This script can change the product key on:
  5. ' Windows XP SP1-SP3, Windows Vista and Windows 7.
  6. '
  7. '***************************************************************************
  8.  
  9. '-> Check for administrative rights.
  10. Dim Wmi :Set Wmi = GetObject("winmgmts:\\.\root\cimv2")
  11.  Dim A, Obj, R
  12.  Set reg = GetObject("winmgmts://./root/default:StdRegProv")
  13.    rc = reg.GetStringValue(&h80000003, "S-1-5-19\Environment", "TEMP", val)
  14.   If rc = 5 Then
  15.   If WScript.Arguments.Count = 0 Then
  16.    CreateObject("Shell.Application").ShellExecute "wscript.exe" _
  17.     , Chr(34) & WScript.ScriptFullName & Chr(34) & " /relaunch", "", "runas", 1
  18.    WScript.Quit 0
  19.   Else
  20.    Msgbox "Cannot acquire admin privileges.",4128,"Admin Access denied"
  21.    WScript.Quit 1
  22.   End If
  23.   Else
  24. '-> Run code here when administrative rights.
  25.   Input()
  26.    ConfirmChange(A)
  27.   End If
  28.    Function Input()
  29.     Input=InputBox( _
  30.      "Type In The New Key In This Format G0NO6-12345-54321-ABCDE-ZYXWV.","Windows XP,Vista,7 CD-Key Changer")
  31.     If Len(Input) = 29 Then A = Input
  32.      If Not Len(Input) = 29 Then
  33.       If MsgBox( _
  34.       "Does Not Appear To Have 29 Characters : " & Len(Input) & vbCrLf & _
  35.       "Would You Like To Redo Your Input, Yes To Redo," & vbCrLf & _
  36.       "No To Exit And Do Nothing?",4132,"Redo or Quit") = 6 Then
  37.       Input()
  38.      Else
  39.       WScript.Quit
  40.      End If
  41.     End If
  42.    End Function
  43.    Function ConfirmChange(K)
  44.     Dim Os
  45.     If MsgBox( _
  46.      "Did you want to continue with changing the OS Product Key?" & vbCrLf & _
  47.      "Yes to continue and change the OS Product Key, No to exit" & vbCrLf & _
  48.      "and make no changes to the OS Product Key",4132,"Continue or Stop") = 6 Then
  49.      For Each Obj In Wmi.ExecQuery("SELECT * FROM win32_OperatingSystem")
  50.        Os = Obj.Caption
  51.       Next
  52.       If InStr(1,Os,"XP",1) Then OsX(Replace(K,"-",""))
  53.       If InStr(1,Os,"7",1) Or InStr(1,Os,"Vista",1)Then V7(K)
  54.     Else
  55.      WScript.Quit
  56.     End If
  57.    End Function
  58.    Function OsX(K)
  59.     On Error Resume Next
  60.      For Each Obj In Wmi.ExecQuery("SELECT * FROM win32_WindowsProductActivation")
  61.       R = Obj.SetProductKey(K)
  62.       If Err = 0 Then MsgBox "Key Has Been Change",4128,"Success"
  63.       If Err <> 0 Then MsgBox "An Error entering the new OS Product Key" & vbCrLf & _
  64.       "Key Enter : " & K & vbCrLf & "Verify that this is the correct or valid" & vbCrLf & _
  65.       "OS Product Key.",4128,"Key Error"
  66.      Next
  67.    End Function
  68.    Function V7(K)
  69.     For Each Obj In Wmi.ExecQuery("SELECT * FROM SoftwareLicensingService")
  70.      R = Obj.InstallProductKey(K)
  71.      If Err = 0 Then MsgBox "Key Has Been Change",4128,"Success"
  72.      If Err <> 0 Then MsgBox "An Error entering the new OS Product Key" & vbCrLf & _
  73.       "Key Enter : " & K & vbCrLf & "Verify that this is the correct or valid" & vbCrLf & _
  74.       "OS Product Key.",4128,"Key Error"
  75.     Next
  76.    End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement