abby
Here is the code
************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer
& "\root\cimv2")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer
& "\root\cimv2")
If objQuickFixID = "KB824146" Then
Wscript.Echo "Computer: " & objQuickFix.CSName
Else
WScript.Echo "Quick fix not found."
End If
> I am trying to write script to detect whether Patch
> KB824146 is installed on a computer but the script
> obviously has errors. Can someone kindly help take a look?
>
> (code snipped)
Hi
This is how I would have done it:
Set oShell = CreateObject("WScript.Shell")
On Error Resume Next
sTmpValue = ""
sTmpValue = oShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT" _
& "\CurrentVersion\HotFix\KB824146\Installed")
On Error Goto 0
If sTmpValue <> 1 Then
WScript.Echo "MS03-039 (KB824146) is not installed"
End If
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter