Is there a way to detect whether there is an antivirus software installed in a machine using C#? I know the Security Center detects antivirus software but how can you detect that in C#?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to Microsoft, The Windows Security Center uses a two-tiered approach for detection status. One tier is manual, and the other tier is automatic through Windows Management Instrumentation (WMI). In manual detection mode, Windows Security Center searches for registry keys and files that are provided to Microsoft by independent software manufacturers. These registry keys and files let Windows Security Center detect the status of independent software. In WMI mode, software manufacturers determine their own product status and report that status back to Windows Security Center through a WMI provider. In both modes, Windows Security Center tries to determine whether the following is true:
An antivirus program is present.
The antivirus signatures are up-to-date.
Real-time scanning or on-access scanning is turned on for antivirus programs.
For firewalls, Windows Security Center detects whether a third-party firewall is installed and whether the firewall is turned on or not.
So in order to determine the presence of an antivirus software, you can use the WMI making a connection to the
root\SecurityCenternamespace (starting with windows Vista you must use theroot\SecurityCenter2namespace), and then query for theAntiVirusProductWMI class.Look at this sample code