How can I query my system via command line to see if a KB patch is installed?

Solution 1:

In addition to systeminfo there is also wmic qfe

Example:

wmic qfe get hotfixid | find "KB99999"
wmic qfe | find "KB99999"

There is also update.exe

Or from powershell, just adjust it for your needs:

Get-WmiObject -query 'select * from win32_quickfixengineering' | foreach {$_.hotfixid}

Solution 2:

PowerShell 2.0 contains the get-hotfix cmdlet, which is an easy way to check if a given hotfix is installed on the local computer or a remote computer. An example of the basic syntax is

get-hotfix -id KB974332

Solution 3:

run "systeminfo" in a CMD window and it will pull back a load of statistics about your system including what patches are installed.


Solution 4:

Some other possibilities: Grep %windir%\Windowsupdate.log for the KB number. Or use reg.exe to export the corresponding install keys.