ShellExecute() (tick_24Pro, cross_24Std, cross_24Lite)

int ShellExecute(array $se)

This function may pose a security risk and a risk for accidental damage such as data loss; use it carefully. Also, enable potentially destructive functions in the Config Files Options Page for it to work.

This function is based on the Microsoft Windows® ShellExecute() function. It can be used to run a program.

$se - an array

$se.File - (required) the file or application to run (a full path is recommended otherwise the current drive and current directory is used); do not surround in quotes

$se.Parameters - (optional) the parameters to be passed; use quotes around arguments as necessary, like for file names containing space characters

$se.Directory - (optional) the full path to the default working directory/folder to use

Returns an integer indicating the status

3 - no error, but the function is disabled because potentially destructive functions are not enabled (new v11.9945)

2 - no error, but did not do anything because this function is not supported in the lite edition

1 - the Windows ShellExecute() function succeeded

0 - the Windows ShellExecute() function failed (the return value is placed in $se.returncode)

-1 - $se doesn't exist or isn't an array

-2 - the Windows ShellExecute() function caused an exception

-3 - array $se does not contain the required data

This function is supported by CSE HTML Validator v11.9914 and later, and is not supported in the lite edition.

Example 1 (opens Windows calculator application)


Example 2 (Batch Wizard)

function onBeforeReportOpen() {
 // notice the quotes added around the arguments
 ShellExecute($se); // opens Windows Notepad with the report file