program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
Winapi.TlHelp32,
Winapi.Windows;
var Task: array[1..11] of string=(
'atieclxx.exe',
'BBSvc.EXE',
'mDNSResponder.exe',
'dragon_updater.exe',
'cavwp.exe',
'cmdagent.exe',
'fraps64.dat',
'fraps.exe',
'HTTPDebuggerSvc.exe',
'SkyDrive.exe',
'sqlwriter.exe');
i: Integer;
function KillProcess(ExeName: string): LongBool;
var
B: BOOL;
ProcList: THandle;
PE: TProcessEntry32;
begin
Result := False;
ProcList := CreateToolHelp32Snapshot(TH32CS_SNAPPROCESS, 0);
PE.dwSize := SizeOf(PE);
B := Process32First(ProcList, PE);
while B do begin
if (UpperCase(PE.szExeFile) = UpperCase(ExtractFileName(ExeName))) then
Result := TerminateProcess(OpenProcess($0001, False, PE.th32ProcessID), 0);
B := Process32Next(ProcList, PE);
end;
CloseHandle(ProcList);
end;
begin
Writeln('Begin');
for I := 1 to 11 do
KillProcess(Task[i]);
Writeln('End');
Readln;
end.