Shortcut Menu

Skip

Main Navigation

Choose your language


ActiveXperts Network Monitor
Monitor servers, workstations, devices and applications in your network

Quicklinks


Windows Activation Scripts

Activating Windows Offline
Activating Windows Online
Identifying Windows Product Activation Status
Suppressing Windows Activation Notices

Activating Windows Offline


Uses the offline method to activate Windows. Requires Windows XP or Windows .NET Server, and a valid activation number.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colWindowsProducts = objWMIService.ExecQuery _
    ("Select * from Win32_WindowsProductActivation")
For Each objWindowsProduct in colWindowsProducts
    ObjWindowsProduct.ActivateOffline("1234-1234")
Next

Activating Windows Online


Uses the online method to activate Windows. Requires Windows XP or Windows .NET Server, and an active Internet connection.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colWindowsProducts = objWMIService.ExecQuery _
    ("Select * from Win32_WindowsProductActivation")
For Each objWindowsProduct in colWindowsProducts
    ObjWindowsProduct.ActivateOnline()
Next

Identifying Windows Product Activation Status


Returns product activation information for a computer.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colWPA = objWMIService.ExecQuery _
    ("Select * from Win32_WindowsProductActivation")
For Each objWPA in colWPA
    Wscript.Echo "Activation Required: " & objWPA.ActivationRequired
    Wscript.Echo "Description: " & objWPA.Description
    Wscript.Echo "Product ID: " & objWPA.ProductID
    Wscript.Echo "Remaining Evaluation Period: " & _
        objWPA.RemainingEvaluationPeriod
    Wscript.Echo "Remaining Grace Period: " & objWPA.RemainingGracePeriod
    Wscript.Echo "Server Name: " & objWPA.ServerName
Next

Suppressing Windows Activation Notices


Suppresses the Windows Activation reminder notices on a computer. This does not preclude the need to activate the computer; it simply prevents users from seeing the periodic reminders.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & _
    "!\\" & strComputer & "\root\cimv2")
Set colWPASettings = objWMIService.ExecQuery _
    ("Select * from Win32_WindowsProductActivation")
 
For Each objWPASetting in colWPASettings
    objWPASetting.SetNotification(0)
Next