Delphi – Free Pascal – Oxygene

Getting the installed Antivirus, AntiSpyware and Firewall software using Delphi and the WMI

The WMI allow you to get the installed Antivirus, AntiSpyware and Firewall (third party) software using the root\SecurityCenter or the root\SecurityCenter2 namespaces and the AntiVirusProduct , AntiSpywareProduct, FirewallProduct classes.

First you must know which these classes and namespaces are not documented by Microsoft and only are supported in Windows Desktops editions (Windows XP, Windows Vista and Windows 7).
Now depending of the Windows version the properties retrieved by the the same class can change. this is a summary of the classes and properties availables depending of the windows version

I’ve developed a Delphi web server that allows the users to upload files; in order to keep the server free of viruses, I’d like to check every single file the users load. Is there a way to call the “file scan process” of the default antivirus by using WMI ¿?

There is not a WMI class to launch the installed antivirus, for this you must use the IAttachmentExecute.Execute (http://msdn.microsoft.com/en-us/library/bb776297%28v=VS.85%29.aspx) method this can run the virus scanners or others trust services to validate the file before executing it. Note that this method can delete or alter the file.