Windows Update Agent API not working in windows 11
We use this API https://learn.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iautomaticupdates-get_settings to retrieve update settings in windows11, but this API will return null.
Below is the windows update status which looks good.
![226952-image.png][1]
2 answers
Sort by: Most helpful
-
-
Limitless Technology 39,646 Reputation points
2022-08-03T07:07:34.473+00:00 Hello,
This may be related in changes in the COM interface between versions, similar to issues between XP-W7-W10. You need to call the DetectNow on your auc object
For example:
WUApiLib.IAutomaticUpdates2 auc = new WUApiLib.AutomaticUpdates(); auc.DetectNow(); // get the current values from the system. Console.WriteLine(auc.Results.LastInstallationSuccessDate); Console.WriteLine(auc.Results.LastSearchSuccessDate);
----------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept as answer--