gpt4 book ai didi

c# - 如何检查是否已从 c# 安装了 Windows QFE/补丁?

转载 作者:可可西里 更新时间:2023-11-01 10:10:40 26 4
gpt4 key购买 nike

在 C# 中确定是否已安装给定 QFE/补丁的最佳方法是什么?

最佳答案

使用 WMI 并检查 Win32_QuickFixEngineering枚举。

来自 TechNet:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colQuickFixes = objWMIService.ExecQuery _
("Select * from Win32_QuickFixEngineering")
For Each objQuickFix in colQuickFixes
Wscript.Echo "Computer: " & objQuickFix.CSName
Wscript.Echo "Description: " & objQuickFix.Description
Wscript.Echo "Hot Fix ID: " & objQuickFix.HotFixID
Wscript.Echo "Installation Date: " & objQuickFix.InstallDate
Wscript.Echo "Installed By: " & objQuickFix.InstalledBy
Next

HotFixID 是您要检查的内容。

这是我系统上的输出:

    Hot Fix ID: KB941569    Description: Security Update for Windows XP (KB941569)    Hot Fix ID: KB937143-IE7    Description: Security Update for Windows Internet Explorer 7 (KB937143)    Hot Fix ID: KB938127-IE7    Description: Security Update for Windows Internet Explorer 7 (KB938127)    Hot Fix ID: KB939653-IE7    Description: Security Update for Windows Internet Explorer 7 (KB939653)    Hot Fix ID: KB942615-IE7    Description: Security Update for Windows Internet Explorer 7 (KB942615)    Hot Fix ID: KB944533-IE7    Description: Security Update for Windows Internet Explorer 7 (KB944533)    Hot Fix ID: KB947864-IE7    Description: Hotfix for Windows Internet Explorer 7 (KB947864)    Hot Fix ID: KB950759-IE7    Description: Security Update for Windows Internet Explorer 7 (KB950759)    Hot Fix ID: KB953838-IE7    Description: Security Update for Windows Internet Explorer 7 (KB953838)    Hot Fix ID: MSCompPackV1    Description: Microsoft Compression Client Pack 1.0 for Windows XP    Hot Fix ID: KB873339    Description: Windows XP Hotfix - KB873339    Hot Fix ID: KB885835    Description: Windows XP Hotfix - KB885835    Hot Fix ID: KB885836    Description: Windows XP Hotfix - KB885836    Hot Fix ID: KB886185    Description: Windows XP Hotfix - KB886185    Hot Fix ID: KB887472    Description: Windows XP Hotfix - KB887472    Hot Fix ID: KB888302    Description: Windows XP Hotfix - KB888302    Hot Fix ID: KB890046    Description: Security Update for Windows XP (KB890046)

关于c# - 如何检查是否已从 c# 安装了 Windows QFE/补丁?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57560/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com