exec(string Program, string Options, int Mode)

Opens an external program, document, URL, or batch file.

Parameters:

Program - file name of the exe, batch file, document, URL to be opened. Use "Editor" for opening the script editor.
Options - command line parameter string to be passed to the program, or 0 for no command line options.
Mode - 1 for waiting until the external program was terminated, otherwise 0.

Returns:

0 if the program was not found or could not be started, otherwise the return code of the program in mode 1, or the process ID in mode 0.

Remarks:

Examples:

exec("notepad","test.txt",0); // open notepad
exec("Editor",strf("Log\\%s.csv",Script),0); // open a .csv file in the Log folder with the editor
exec("c:\\program files\\internet explorer\\iexplore.exe","http://www.zorro-trader.com",0); // open an URL with Internet Explorer
exec("http://www.zorro-trader.com",0,0); // open an URL with the standard browser
exec("Zorro",strf("-train %s",Script),0); // start another Zorro instance in training mode

See also:

window, keys ► latest version online