1

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?

Community
  • 1
  • 1
  • You have already ask this question http://stackoverflow.com/questions/9920434/third-party-firewall-name-fetch. Please do not ask it again. – Arion Mar 29 '12 at 07:21
  • @Arion Hey that question was closed because i wrote the subject of my question in a wrong way by mistake.I have just rectified my mistake here. – user1297661 Mar 29 '12 at 07:25
  • @Arion i wrote firewall instead of antivirus there ( in the subject line ) . Still thanks for your concern. – user1297661 Mar 29 '12 at 07:26

1 Answers1

1

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"));
 }
default locale
  • 13,035
  • 13
  • 56
  • 62