Listing and Comparing Microsoft Patches in a PC

 

There are always times when you need to be able to compare the MS hotfixes on one machine to another machine, examples being:

  1. Computer has no internet access
  2. Hotfixes or patches have been applied that are not available on Windows Update

Obtain the two lists

Command Prompt:

Wmic qfe get hotfixid

To output this to a file:

Wmic qfe get hotfixid > c:\HotfixList.txt

Powershell:

get-hotfix |select-object hotfixid c:\HotfixList.txt

Compare the two lists

  1. Open up the two lists in Notepad
  2. Open up a blank Excel workbook
  3. Copy and paste the contents into two separate columns

Now the problem here is both columns have contents that have trailing spaces… so

  1. Press Ctrl-A to select the whole sheet
  2. Press Ctrl F and chose to replace a space with nothing (i.e. in replace tab , click on “find what” and press the space bar once. Then press the “replace all” button
  3. Sort each column (a-z) – the is important for the vlookup we are going to use

So what does the Vlookup function in excel do?

Put simply – VLOOKUP retrieves information from a database/list (a row or rows) based on a supplied instance of the unique identifier (what is in a specific cell).

 

 

hotfix1

 

 

hotfix2

hotfix3

So now Select B1 ,then  hover the mouse over the green square in the bottom right corner and click and hold it, and drag it down the column. Release it and you will find the column has been automatically populated with formula

hotfix4

The cells in column B that have #N/A indicates the contents in cell F(x) do not exist in column H

In the example above KB2887595 does not exist in column H

So there you have it an easy way to find out what  hotfixes that are in “Computer F” are missing in “Computer H”

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.