Function exec

Top 

Declaration:

int exec(char program[], char params[], char work_dir[], int show=SW_SHOW);

Description

Starts a Windows application or DOS.

Parameters:

  program - the name of the file under execution

  params - the command line parameters

  work_dir - the working directory for the application to be started

  show   - the constant to define the application window display mode.

             Constants with the SW_ prefix are given in system.h.

Note that the script file will not wait for the started application to stop operation, if special measures are not taken.

Returned value

What was returned by the function API ShellExecute, that is, HINSTANCE of the application or error message.

Example

exec("pifedit.exe", "command.pif");