Search code examples
javascriptnode.jswindowswmiupdates

Is it possible to get a list of installed Windows Updates using node.js?


I am working on a project in JavaScript/Node.js and I want to fetch a list of all installed windows updates similar to using the C# WUAPI 2.0 Type Library.

I tried using WMI calls(win32_QuickFixEngineering class) but it returns a very incomplete list on all windows versions after vista.

Does anyone know if I can get a list of updates including the knowledgebase updates? I really want to avoid creating a c# .exe and having to serialize the data into json and send it from the c# app to my node.js app.


Solution

  • Simple as this:

    const childProcess = require('child_process');
    let result = childProcess.execSync('wmic qfe list').toString();
    console.log(result);
    

    Of course you should use try catch and also parse the resulting string to get more useful data :)