function ExecAppAndWait(AppPath, Parameters: string): boolean;

 

This function works similarly to the ExecApp function: itexecutes an external application but does not return immediately.
This function actually waits for the executed program to terminate, thus the return value will be True only if the executed program's exit code is 0 (zero).

 
Warning: if the executed program doesn't terminate or takes too long to terminate, this function may timeout and cut the user connection.

 

Parameters

AppPath

The fully qualified path to the application to be run

Parameters

Optional command-line parameters to be passed to the launched application

 

Return value

Boolean

Returns True if the application terminated successfully (exit code 0), otherwise it will return False

 

Example usage


// The following example runs a Syncplify.me FTP Script! script passing it as a parameter
// to the Syncplify.me FTP Script! Execution Environment, it waits until the end
// of the execution and returns True if the exit code was 0 (zero)
begin
  ExecAppAndWait('C:\Program Files\Syncplify.me\FTP Script!\FtpScripterEx.exe''C:\MyScripts\TestScript.fscrpas);
end.