User Tools

Site Tools


startexternalprocess

StartExternalProcess

The StartExternalProcess function starts an external process. The function returns false if no arguments are passed or if starting of the process fails.

Note: The function is not available on all platforms due to system and security restrictions.

Parameters

  • command: The command to execute.
  • arguments: The arguments for the command.
  • waitUntilFinished (since 1.0.1): If true then the function blocks until the process finishes. If false, then the function immediately returns.
  • waitTimeoutMS (since 1.0.1): The timeout for the command.
  • returnResultData (since 1.0.1): If true then the output of the command is returned as text.

Syntax

(bool|string): StartExternalProcess(string command, [array arguments = [], bool waitUntilFinished = false, int waitTimeoutMS = 10000, bool returnResultData = false])

Examples

var result = StartExternalProcess();
// result: false

var result = StartExternalProcess('c:/test/test.exe');
// starts the external program "test.exe".

var args = ["A", "B"];
var result = StartExternalProcess('c:/test/test.exe', args);
// starts the external program with arguments "test.exe A B".

var args = ["A", "B"];
var result = StartExternalProcess('c:/test/test.exe', args, true, 10000, true);
// starts the external program with arguments "test.exe A B" and waits 10
// seconds. If the command succeeds then the result string is returned.
// If the command fails (or times out) then false is returned.
startexternalprocess.txt · Last modified: 2016/09/19 14:31 by act