Check for installed updates programmatically


O

om

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?
 
Ad

Advertisements

B

Bob F.

om said:
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?
 
O

om

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.
 
M

Mark L. Ferguson

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/help/help_en-us.htm#RateAPost

Mark L. Ferguson

..
om said:
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.
 
O

om

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?

Bob, thank you - I'm aware of that, but i need this programmatically.
 
M

Mark L. Ferguson

"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/help/help_en-us.htm#RateAPost

Mark L. Ferguson

..
om said:
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.
 
Ad

Advertisements

J

Joe Morris

om said:
[...]
Go to Control Panel > Windows Update > View Update History and check for
your updates. Hotfixes are included if you did any.
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top