views:

336

answers:

1

I would like to have a batch file display which service pack it has installed, which internet explorer version it has installed, and which version of windows media player it has installed. This would be for windows xp only. The reason why I need this is because I have a script that can install windows updates offline but when it comes to service packs I dont always know which ones are installed so it would be nice to have the same batch file that can install the updates/service packs silently could also display what service packs are installed.

A: 

Here a VBS that will show which service packs are installed (From here):

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
Shay Erlichmen