Is there a C# equivalent to this? I have tried using WMI and simply get "Windows Defender" regardless of the installed WMI compliant AntiVirus.
I simply want to display these results in a textbox.
WMIC /Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get displayName /Format:List
When I use the code above I get the actual name of my AntiVirus.
You can add a reference to
System.Management
. Then usingManagementObjectSearcher
you can run a WMI query.To find installed antiviruses you should search in
SecurityCenter2
. For example:Note 1: For Windows XP, search in
SecurityCenter
.Note 2: You can also read other properties of the
AntiVirusProduct
:displayName
:string
instanceGuid
:string
pathToSignedProductExe
:string
pathToSignedReportingExe
:string
productState
:UInt32
. (For information on how to parse the status, take a look at this post.)timestamp
:string