Question

I am exploring the reliability of the following two ways to get the Windows Patch Information.

  1. Using Windows Update Agent - IUpdateSearcher Interface with COM.
  2. Using WMIC QFE GET (Either through client or WMI Interfaces with COM)

Below are the queries I have for the above two methods

Using Windows Update Agent - IUpdateSearcher Interface with COM.

  1. Does IUpdateSearcher navigates through the following registry and provides the information?
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing
  2. Are there any other registry paths IUpdateSearcher looks for to give Update information?
  3. Does IUpdateSearcher give a super set of what WMIC QFE gives?

Using WMIC QFE GET (Either through client or WMI Interfaces with COM)

  1. Does WMIC QFE search the following registry path and provides the information? HKEY_LOCAL_MACHINE\Software\Microsoft\Updates (OR) HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Updates
  2. Are there any other registry paths WMIC QFE GET looks for to give Update information?

Also, Of the above two ways,

  1. Which method is the best way to get the Update Information without data loss?
  2. Which method performs faster?

Could someone provide answers for all my queries?

Was it helpful?

Solution

When you uses the WMIC QFE GET command is equivalent to execute a query with the Win32_QuickFixEngineering WMI class, since with Windows Vista, this class returns only the updates supplied by Component Based Servicing, in olders windows versions uses the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates registry keys to enumerate the updates.

The IUpdateSearcher interface which is part of the Windows Update Agent API (WUA), can be used to enumerate all the fixes including the installed via the CBS, Updates supplied by Microsoft Windows Installer (MSI) or the Windows update site, and so on.

So the more reliable way to get the installed windows updates is using the WUA API.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top