如何获得Windows成功更新的上一次?

发布于 2025-02-09 19:05:59 字数 275 浏览 0 评论 0原文

我试图通过C ++在机器上更新Windows的上一次日期和时间。我已经成功地通过PowerShell这样的做到了: 字符串lastUpdate = exec(“ powershell.exe $(new -object -comboct microsoft.update.autoupdate).results.lastsearchsearchsuccessdate”);

,但是由于它通过powershell运行整个程序的其余部分,所以我想知道是否有任何简单的方法可以通过C ++进行操作?

I am attempting to get a date and time of the last time Windows updated on a machine through C++. I have been successfully able to do it through powershell like so:
string LastUpdate = exec("powershell.exe $(New-Object -ComObject Microsoft.Update.AutoUpdate).Results.LastSearchSuccessDate");

However due to it being run through powershell, it kind of delays the whole rest of the program, so i was wondering if there is any easy ways to do it through C++?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文