Search code examples
windowswinapiwindows-update

How to check if a given KB is installed on Windows?


Is there a way to check if a given KB is installed on Windows? Specifically, I'd like to find out if KB2999226 is installed on Windows Server 2012 R2.

Thanks.


Solution

  • As already mentioned in the comment section of the question, you need to explore the Windows Update Agent API to exactly achieve this.

    To search for an update say KBDDDDDDD using cmd, you can use the following:

    wmic qfe get hotfixid | find "KBDDDDDDD"
    

    You can directly call this query in C++ with the help of system() function. Please check this post to know about how to Execute CMD commands using C++.