How to identify installed anti-spyware applications on XP using WMI

Do I need to get information about spyware installed on a client machine using WMI? Is it possible?

0


source to share


1 answer


I found this sample code on the Danish site Udvikleren.dk , I hope you find it helpful. You can also use to search for antivirus by replacing "AntiSpywareProduct" with "AntiVirusProduct".



uses Windows, WbemScripting_TLB, ActiveX, ComObj;

var
Locator:ISWbemLocator;
Services:ISWbemServices;
ResultSet:ISWbemObjectSet;
Enum :IEnumVariant;
Item :OleVariant;
Value:LongWord;
begin
CoInitializeEx(nil, 0);

CoInitializeSecurity(nil, -1, nil, nil, 0, 3, nil, 0, 0);

Locator:=CoSWbemLocator.Create as ISWbemLocator;
Services:=Locator.ConnectServer('.', 'root\SecurityCenter', '', '', '', '', 0, nil);
ResultSet:=Services.ExecQuery('SELECT * FROM AntiSpywareProduct', 'WQL', wbemFlagReturnImmediately or wbemFlagBidirectional,nil);
Enum:=ResultSet._NewEnum as IEnumVariant;

enum.Reset;

while Enum.Next(1,item,value) = S_OK do
  writeln(Item.displayName, '. Enabled: ',Item.productEnabled);
end;

      

+1


source







All Articles