I want to make program that starts external exe and kill's it after some time
this is code
**************
program start_kill;
uses
Classes, SysUtils, Process;
var
AProcess: TProcess;
BProcess: TProcess;
{$IFDEF WINDOWS}{$R shakeme_gotovo.rc}{$ENDIF}
begin
AProcess := TProcess.Create(nil);
AProcess.CommandLine := 'C:\WINDOWS\System32\dxdiag.exe';
AProcess.Options := AProcess.Options;
AProcess.Execute;
while AProcess.Running do
begin
sleep(1000);
BProcess := TProcess.Create(nil);
BProcess.Commandline := 'C:\Windows\system32\tskill.exe dxdiag';
BProcess.Options := BProcess.Options;
BProcess.Execute;
end;
AProcess.Free;
BProcess.Free;
end.
*****************
Now i dont want it to popup/take fokus but only to start and kill proces without notifications
How to set program in background ?Best regards to all
