Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Script to detect specific patch is not working

13 views
Skip to first unread message

Help

unread,
Oct 22, 2003, 4:18:49 AM10/22/03
to
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?
Thanks in advance.

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

Torgeir Bakken (MVP)

unread,
Oct 22, 2003, 6:04:49 AM10/22/03
to
Help wrote:

> 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


0 new messages