Skip to content

Instantly share code, notes, and snippets.

@Ruzzz
Created April 26, 2014 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ruzzz/11318260 to your computer and use it in GitHub Desktop.
Save Ruzzz/11318260 to your computer and use it in GitHub Desktop.
Show WinXP activation info
computer = "." ' Current
set wmiService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & computer & "\root\cimv2")
set products = wmiService.ExecQuery("Select * from Win32_WindowsProductActivation")
for each product in products
text = "Machine name: " & product.ServerName & vbCrLf & _
"ProductID: " & product.ProductID & vbCrLf
if product.ActivationRequired = false then _
text = text & "No activation required!" & vbCrLf
text = text & _
product.RemainingGracePeriod & " days remaining before activation of the system is required" & vbCrLf & _
product.RemainingEvaluationPeriod & " days remaining before expiration of the media" & vbCrLf & _
"SettingID: " & product.SettingID & vbCrLf & _
"Description: " & product.Description & vbCrLf & _
"Caption: " & product.Caption
WScript.Echo text
'product.ActivateOnline()
'product.SetNotification(0)
'product.SetProductKey(XXXXX-XXXXX-XXXXX-XXXXX-XXXXX)
next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment