How can i kill running process on some other machine (over the network) using Delphi?
Everything you need can be found at The Road to Delphi, he just blog'd about how to do this on November 6th, check this link WMI Tasks using Delphi – Processes
.
You can use the WTSTerminateProcess API or use Jwscl (Windows Security Library) Terminal Server unit (the TJwWTSProcess class offers a Terminate method).
Small code example:
var
TS: TJwTerminalServer;
begin
TS := TJwTerminalServer.Create('Remote');
try
if TS.EnumerateProcess then
begin
for i := 0 to TS.Processes.Count -1 do
begin
if TS.Processes[i].Name = 'notepad.exe' then
begin
TS.Processes[i].Terminate;
end;
end;
end;
finally
TS.Free;
end;
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With