user1297661
user1297661

Reputation: 37

Third Party Antivirus Name Fetch

Detect Antivirus on Windows using C#

This link tells whether antivirus is installed in the system or not ? Can we code in such a way that we fetch the name of the antivirus installed too?

Upvotes: 1

Views: 600

Answers (1)

default locale
default locale

Reputation: 13456

You need to access wmi displayName property for each antivirus instance. Use ManagementBaseObject.Properties

 string wmipathstr = @"\\" + Environment.MachineName + @"\root\SecurityCenter2";
 var searcher = new ManagementObjectSearcher(wmipathstr, "SELECT * FROM AntivirusProduct");
 var instances = searcher.Get();
 foreach (var instance in instances)
 {
     Console.WriteLine(instance.GetPropertyValue("displayName"));
 }

Upvotes: 1

Related Questions