0

我需要获取有关使用 WMI 安装在客户端计算机上的间谍软件的信息吗?这可能吗?

4

1 回答 1

1

我在丹麦网站Udvikleren.dk上找到了这个代码示例,希望它对你有用。也可用于通过将“AntiSpywareProduct”替换为“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;
于 2009-01-04T13:46:57.010 回答