<p>What's the best way in c# to determine is a given QFE/patch has been installed?</p>

[{'answer_id': 57626, 'author': 'rpetrich', 'author_id': 4007, 'author_profile': 'https://Stackoverflow.com/users/4007', 'pm_score': 1, 'selected': False, 'text': "<p>The most reliable way is to determine which files are impacted by the QFE and use <code>System.Diagnostics.FileVersionInfo.GetVersionInfo(path)</code> on each file and compare the version numbers.</p>\n\n<p>edit: I think there's a way to check the uninstall information in the registry as well, but if the QFE ever becomes part of a Service Pack or rollup package that might report false negatives</p>\n"}, {'answer_id': 205258, 'author': 'Bob King', 'author_id': 6897, 'author_profile': 'https://Stackoverflow.com/users/6897', 'pm_score': 3, 'selected': True, 'text': '<p>Use WMI and inspect the <a href="http://msdn.microsoft.com/en-us/library/aa394391.aspx" rel="nofollow noreferrer">Win32_QuickFixEngineering</a> enumeration.</p>\n\n<p>From TechNet:</p>\n\n<pre><code>strComputer = "."\nSet objWMIService = GetObject("winmgmts:" _\n    &amp; "{impersonationLevel=impersonate}!\\\\" &amp; strComputer &amp; "\\root\\cimv2")\nSet colQuickFixes = objWMIService.ExecQuery _\n    ("Select * from Win32_QuickFixEngineering")\nFor Each objQuickFix in colQuickFixes\n    Wscript.Echo "Computer: " &amp; objQuickFix.CSName\n    Wscript.Echo "Description: " &amp; objQuickFix.Description\n    Wscript.Echo "Hot Fix ID: " &amp; objQuickFix.HotFixID\n    Wscript.Echo "Installation Date: " &amp; objQuickFix.InstallDate\n    Wscript.Echo "Installed By: " &amp; objQuickFix.InstalledBy\nNext\n</code></pre>\n\n<p><strong>The HotFixID is what you want to examine.</strong></p>\n\n<p>Here\'s the output on my system:</p>\n\n<pre>\n    Hot Fix ID: KB941569\n    Description: Security Update for Windows XP (KB941569)\n    Hot Fix ID: KB937143-IE7\n    Description: Security Update for Windows Internet Explorer 7 (KB937143)\n    Hot Fix ID: KB938127-IE7\n    Description: Security Update for Windows Internet Explorer 7 (KB938127)\n    Hot Fix ID: KB939653-IE7\n    Description: Security Update for Windows Internet Explorer 7 (KB939653)\n    Hot Fix ID: KB942615-IE7\n    Description: Security Update for Windows Internet Explorer 7 (KB942615)\n    Hot Fix ID: KB944533-IE7\n    Description: Security Update for Windows Internet Explorer 7 (KB944533)\n    Hot Fix ID: KB947864-IE7\n    Description: Hotfix for Windows Internet Explorer 7 (KB947864)\n    Hot Fix ID: KB950759-IE7\n    Description: Security Update for Windows Internet Explorer 7 (KB950759)\n    Hot Fix ID: KB953838-IE7\n    Description: Security Update for Windows Internet Explorer 7 (KB953838)\n    Hot Fix ID: MSCompPackV1\n    Description: Microsoft Compression Client Pack 1.0 for Windows XP\n    Hot Fix ID: KB873339\n    Description: Windows XP Hotfix - KB873339\n    Hot Fix ID: KB885835\n    Description: Windows XP Hotfix - KB885835\n    Hot Fix ID: KB885836\n    Description: Windows XP Hotfix - KB885836\n    Hot Fix ID: KB886185\n    Description: Windows XP Hotfix - KB886185\n    Hot Fix ID: KB887472\n    Description: Windows XP Hotfix - KB887472\n    Hot Fix ID: KB888302\n    Description: Windows XP Hotfix - KB888302\n    Hot Fix ID: KB890046\n    Description: Security Update for Windows XP (KB890046)\n</pre>\n'}]
['https://Stackoverflow.com/questions/57560', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2564/']