View Single Post
Old 02-28-2008   #7 (permalink)
Joe Morris


 
 

Re: Check for installed updates programmatically

"om" <omagen@xxxxxx> wrote:
Quote:

> "Bob F." <b...@xxxxxx> wrote:
Quote:

>> "om" <oma...@xxxxxx> wrote in message
Quote:
Quote:
Quote:

>> > Is there a good way of finding out if a HotFix update is installed on
>> > a user's machine?
[...]
Quote:
Quote:

>> Go to Control Panel > Windows Update > View Update History and check for
>> your updates. Hotfixes are included if you did any.
Quote:

> Bob, thank you - I'm aware of that, but i need this programmatically.
It's a bit indirect but depending on how you're writing the process that
needs this information, you can use WMIC. If the correct form of the hotfix
name is KB123456, the command:

WMIC QFE WHERE HOTFIXID='KB123456'

will produce a zero-length SYSERR output if KB123456 is present. If
KB123456 is not present, the command will produce a 6-byte SYSOUT string.

This is a hack; if you're using wscript the code suggested by Mark Ferguson
elsewhere in the thread would be a better choice...or consider using
PowerShell if you can assume that it's installed on the systems on which
your program will run.

Joe Morris


My System SpecsSystem Spec