Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista General

Vista Tutorial - Check for installed updates programmatically

Reply
 
Old 02-28-2008   #1 (permalink)
om
Guest


 
 

Check for installed updates programmatically

Hello.
Is there a good way of finding out if a HotFix update is installed on
a user's machine?

I need to know on install time if this hot fix is installed or not. I
know the hotfix appears in the Add Remove Programs , and therefore i
assumed there's a registry entry for it. It seems like its not as easy
as i hoped: I found it under:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
\Component Based Servicing\PackageDetect\Microsoft-Windows-Foundation-
Package~31bf3856ad364e35~x86~~0.0.0.0]

But to enumerate that key for the specific hotfix that i'm looking for
seems like not the right approach.

Any ideas?

My System SpecsSystem Spec
Old 02-28-2008   #2 (permalink)
Bob F.
Guest


 
 

Re: Check for installed updates programmatically

"om" <omagen@xxxxxx> wrote in message
news:27cfd5c7-be6d-47d6-ac4e-e4176c02ba11@xxxxxx
Quote:

> Hello.
> Is there a good way of finding out if a HotFix update is installed on
> a user's machine?
>
> I need to know on install time if this hot fix is installed or not. I
> know the hotfix appears in the Add Remove Programs , and therefore i
> assumed there's a registry entry for it. It seems like its not as easy
> as i hoped: I found it under:
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
> \Component Based Servicing\PackageDetect\Microsoft-Windows-Foundation-
> Package~31bf3856ad364e35~x86~~0.0.0.0]
>
> But to enumerate that key for the specific hotfix that i'm looking for
> seems like not the right approach.
>
> Any ideas?

Go to Control Panel > Windows Update > View Update History and check for
your updates. Hotfixes are included if you did any.
--
BobF.
Lincoln actually got it right but was way ahead of his time when he said,
"You can have some of you computer working all of the time and all of your
computer working some of the time but..." It was he that said that, wasn't
it?

My System SpecsSystem Spec
Old 02-28-2008   #3 (permalink)
om
Guest


 
 

Re: Check for installed updates programmatically

On Feb 28, 12:10 pm, om <oma...@xxxxxx> wrote:
Quote:

> Hello.
> Is there a good way of finding out if a HotFix update is installed on
> a user's machine?
>
> I need to know on install time if this hot fix is installed or not. I
> know the hotfix appears in the Add Remove Programs , and therefore i
> assumed there's a registry entry for it. It seems like its not as easy
> as i hoped: I found it under:
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
> \Component Based Servicing\PackageDetect\Microsoft-Windows-Foundation-
> Package~31bf3856ad364e35~x86~~0.0.0.0]
>
> But to enumerate that key for the specific hotfix that i'm looking for
> seems like not the right approach.
>
> Any ideas?
I am using wusa.exe to run this hotfix on machines that need it - i
just cant find enough documentation about the return codes from
wusa.exe. Maybe there is a return code saying "already installed" or
something in that nature.
My System SpecsSystem Spec
Old 02-28-2008   #4 (permalink)
Mark L. Ferguson
Guest


 
 

Re: Check for installed updates programmatically

systeminfo > list.txt
find "123456" list.txt

--
Was this helpful? Then click the "Yes" Ratings button. Voting helps the web
interface.
http://www.microsoft.com/wn3/locales....htm#RateAPost

Mark L. Ferguson

..
"om" <omagen@xxxxxx> wrote in message
news:54438995-f84f-4dd0-90f1-1b58045db822@xxxxxx
Quote:

> On Feb 28, 12:10 pm, om <oma...@xxxxxx> wrote:
Quote:

>> Hello.
>> Is there a good way of finding out if a HotFix update is installed on
>> a user's machine?
>>
>> I need to know on install time if this hot fix is installed or not. I
>> know the hotfix appears in the Add Remove Programs , and therefore i
>> assumed there's a registry entry for it. It seems like its not as easy
>> as i hoped: I found it under:
>>
>> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
>> \Component Based Servicing\PackageDetect\Microsoft-Windows-Foundation-
>> Package~31bf3856ad364e35~x86~~0.0.0.0]
>>
>> But to enumerate that key for the specific hotfix that i'm looking for
>> seems like not the right approach.
>>
>> Any ideas?
>
> I am using wusa.exe to run this hotfix on machines that need it - i
> just cant find enough documentation about the return codes from
> wusa.exe. Maybe there is a return code saying "already installed" or
> something in that nature.
My System SpecsSystem Spec
Old 02-28-2008   #5 (permalink)
om
Guest


 
 

Re: Check for installed updates programmatically

On Feb 28, 12:19 pm, "Bob F." <b...@xxxxxx> wrote:
Quote:

> "om" <oma...@xxxxxx> wrote in message
>
> news:27cfd5c7-be6d-47d6-ac4e-e4176c02ba11@xxxxxx
>
>
>
Quote:

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

> > I need to know on install time if this hot fix is installed or not. I
> > know the hotfix appears in the Add Remove Programs , and therefore i
> > assumed there's a registry entry for it. It seems like its not as easy
> > as i hoped: I found it under:
>
Quote:

> > [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
> > \Component Based Servicing\PackageDetect\Microsoft-Windows-Foundation-
> > Package~31bf3856ad364e35~x86~~0.0.0.0]
>
Quote:

> > But to enumerate that key for the specific hotfix that i'm looking for
> > seems like not the right approach.
>
Quote:

> > Any ideas?
>
> Go to Control Panel > Windows Update > View Update History and check for
> your updates. Hotfixes are included if you did any.
> --
> BobF.
> Lincoln actually got it right but was way ahead of his time when he said,
> "You can have some of you computer working all of the time and all of your
> computer working some of the time but..." It was he that said that, wasn't
> it?
Bob, thank you - I'm aware of that, but i need this programmatically.
My System SpecsSystem Spec
Old 02-28-2008   #6 (permalink)
Mark L. Ferguson
Guest


 
 

Re: Check for installed updates programmatically

"cscript get update history.vbs"

--Get update history.vbs--
Set objSession = CreateObject("Microsoft.Update.Session")
Set objSearcher = objSession.CreateUpdateSearcher
intHistoryCount = objSearcher.GetTotalHistoryCount

Set colHistory = objSearcher.QueryHistory(1, intHistoryCount)

For Each objEntry in colHistory
Wscript.Echo "Operation: " & objEntry.Operation
Wscript.Echo "Result code: " & objEntry.ResultCode
Wscript.Echo "Exception: " & objEntry.Exception
Wscript.Echo "Date: " & objEntry.Date
Wscript.Echo "Title: " & objEntry.Title
Wscript.Echo "Description: " & objEntry.Description
Wscript.Echo "Unmapped exception: " & objEntry.UnmappedException
Wscript.Echo "Client application ID: " & objEntry.ClientApplicationID
Wscript.Echo "Server selection: " & objEntry.ServerSelection
Wscript.Echo "Service ID: " & objEntry.ServiceID
i = 1
For Each strStep in objEntry.UninstallationSteps
Wscript.Echo i & " -- " & strStep
i = i + 1
Next
Wscript.Echo "Uninstallation notes: " & objEntry.UninstallationNotes
Wscript.Echo "Support URL: " & objEntry.SupportURL
Wscript.Echo
Next
--end file--
--
Was this helpful? Then click the "Yes" Ratings button. Voting helps the web
interface.
http://www.microsoft.com/wn3/locales....htm#RateAPost

Mark L. Ferguson

..
"om" <omagen@xxxxxx> wrote in message
news:54438995-f84f-4dd0-90f1-1b58045db822@xxxxxx
Quote:

> On Feb 28, 12:10 pm, om <oma...@xxxxxx> wrote:
Quote:

>> Hello.
>> Is there a good way of finding out if a HotFix update is installed on
>> a user's machine?
>>
>> I need to know on install time if this hot fix is installed or not. I
>> know the hotfix appears in the Add Remove Programs , and therefore i
>> assumed there's a registry entry for it. It seems like its not as easy
>> as i hoped: I found it under:
>>
>> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
>> \Component Based Servicing\PackageDetect\Microsoft-Windows-Foundation-
>> Package~31bf3856ad364e35~x86~~0.0.0.0]
>>
>> But to enumerate that key for the specific hotfix that i'm looking for
>> seems like not the right approach.
>>
>> Any ideas?
>
> I am using wusa.exe to run this hotfix on machines that need it - i
> just cant find enough documentation about the return codes from
> wusa.exe. Maybe there is a return code saying "already installed" or
> something in that nature.
My System SpecsSystem Spec
Old 02-28-2008   #7 (permalink)
Joe Morris
Guest


 
 

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
Reply

Thread Tools


Similar Threads
Thread Forum
Export Installed updates(windows updates) Vista General
Check For Updates Windows Updates
Check if Powershell is installed? PowerShell
Check to see which DirectX is installed Tutorials
HELP! Can't change Automatic Updates or check for updates! Vista performance & maintenance


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46