Link to home
Start Free TrialLog in
Avatar of hirenshah
hirenshah

asked on

File Execution ...

By using << ShellExecute >> function it have run 3 executable files. But it get executated one by one. It does not wait till previous execution get completed.

How can I execute file and wait till first execution completed and then execute another file in loop.

ASKER CERTIFIED SOLUTION
Avatar of inthe
inthe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Madshi
Madshi

Barry, would you please correct your answers database?   :-)

function WinExecAndWait32(FileName:String; Visibility : integer):integer;
begin
  [...]
    GetExitCodeProcess(ProcessInfo.hProcess,Result);
    CloseHandle(ProcessInfo.hProcess);  // add this one
    CloseHandle(ProcessInfo.hThread );  // and this one
  end;
end;

Regards, Madshi.