How to get hotfix details installed on machine
How to get installed hotfix and service related information in c#
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Posted Dec 1, 2017, 6:26 AM
nilesh phulePosted Dec 21, 2011, 3:39 AM
Sam HobbsPosted Dec 18, 2011, 4:07 AM
A WMI connection string does have multiple parts. I do not understand all the parts. As best as I know, the .Net Management classes do not use all the parts; it might be that some of the parts are implied and never specified by us and never shown to us.
A WMI connection string will be in the format used in the script for any unmanaged code; whether the code is VBScript, JavaScript, C++ or any unmanaged code. It is not the language that has any relevant affect whatsoever; it is that the .Net Management classes simplifies things, which can make things very confusing without an explanation, and it is typical for Microsoft to not explain things like that.
VulpesPosted Dec 17, 2011, 8:48 AM
The problem is if I try to graft the connection string, as it stands, into the C# code I posted earlier:
It compiles OK but when I run it (Windows 7) I get:
Sam HobbsPosted Dec 16, 2011, 5:10 PM
So I should have just said that the Win32_QuickFixEngineering class could be used. In this case, less is more.
Probably the problem you encountered with the VBScript code is the continuation. The following is a modified version.
Set colQuickFixes = objWMIService.ExecQuery ("Select * from Win32_QuickFixEngineering")
For Each objQuickFix in colQuickFixes
Wscript.Echo "Description: " & objQuickFix.Description
Wscript.Echo "Hotfix ID: " & objQuickFix.HotFixID
Next
VulpesPosted Dec 16, 2011, 4:28 PM
Sam HobbsPosted Dec 16, 2011, 1:47 PM
VulpesPosted Dec 16, 2011, 8:39 AM
Sam HobbsPosted Dec 16, 2011, 4:22 AM
How about we do this. If you read the articles in this web site about the classes in the System.Management Namespace for using WMI then I or someone will fill in the parts that you need help with. Please don't avoid trying just because you assume you cannot do it.
nilesh phulePosted Dec 16, 2011, 2:36 AM
Sam HobbsPosted Dec 15, 2011, 3:55 PM
You can list the hotfixes installed in a computer using WMI. You can use the .Net System.Management Namespace to use WMI; look in this web site for articles about using WMI. The following is VBscript code that does what you need; I hope this is enough for you to be able to determine how to do it using C#.
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colQuickFixes = objWMIService.ExecQuery _
("Select * from Win32_QuickFixEngineering")
For Each objQuickFix in colQuickFixes
Wscript.Echo "Description: " _
& objQuickFix.Description
Wscript.Echo "Hotfix ID: " & objQuickFix.HotFixID
Next
Satyapriya NayakPosted Dec 15, 2011, 10:32 AM
Please refer the below link
http://www.ehow.com/how_5229661_install-microsoft-hotfixes.html
Thanks