- execute a file

Basic price pattern detection
(AmiBroker 5.40)

SYNTAX ShellExecute( ''filepath'', ''arguments'', ''parameters'', showcmd = 1 )
FUNCTION The function opens a file or runs executable.

It is equivalent of Windows API ShellExecute, with one difference, it always uses "open" verb. This allows running executables, scripts, opening document files using their associated editors, etc.

If the function succeeds, it returns a value greater than 32. If the function fails, it returns an error value that indicates the cause of the failure.

For possible error codes, consult Microsoft documentation:

In AmiBroker version 6.20 this function provides special feature that allows to run batches. If you use "runbatch" in first parameter you can specify the batch (.abb) file in 2nd argument and it will start a batch.

EXAMPLE // run notepad
ShellExecute("notepad.exe", "", "" );

// run batch
ShellExecute("runbatch", "", "" );


The ShellExecute function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.