List the Latest Installed Service Pack
Description
Returns the last service pack to be installed on a computer.
Supported Platforms
Windows Server 2003
Yes
Windows XP
Yes
Windows 2000
Yes
Windows NT 4.0
Yes
Windows 98
Yes
Script Code
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Wscript.Echo objOperatingSystem.ServicePackMajorVersion _
& "." & objOperatingSystem.ServicePackMinorVersion
Next
Works from a XP computer with full Amin. rights.