WMIを使用してクライアントマシンにインストールされているスパイウェアに関する情報を取得する必要がありますか?これは可能ですか?
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 に答える