User Tools

Site Tools


gemus_script_reference:functions:run_program

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

gemus_script_reference:functions:run_program [2020/05/12 11:27] (current)
Jimbo created
Line 1: Line 1:
 +Back to [[.:|Script Function Reference]]
  
 +====== Run_Program() ======
 +
 +The Run_Program() function runs a program/​application and optionally waits until it terminates before continuing with the script.
 +
 +===== Syntax =====
 +
 +<​code>​Run_Program(filenum/​filename||clp||waitflag)</​code>​
 +
 +===== Arguments =====
 +
 +^ Argument ^ Required ^ Description ^
 +| //​filenum/​filename//​ | Yes | The number of the file set in the script'​s [[..:​associated_files|associated files]] list that you want to execute, or the absolute path\filename you want to execute. If this file is not directly executable, it will be run with its default program (e.g. if you set the file to be a text file, it will probably be opened in notepad). If you are using an absolute path\filename,​ any [[..:​environment_variables|script environment variables]] found in //​filename//​ will be replaced by their actual values when the script is executed. |
 +| //clp // | No | The text to add to the command line of the program being executed. Any [[..:​environment_variables|script environment variables]] found in //clp// will be replaced by their actual values when the script is executed. To specify no command line parameters, set this to an empty string (see example 1). If the script is set to use long filenames, any replaced environment variables that correspond to a filepath or filename will be surrounded by double quotes (""​) only if they contain a space character. |
 +| //​waitflag//​ | Yes | This must be one of two literal strings: WAIT or NOWAIT. If you want the script to pause until the executed program has terminated before continuing, set this parameter to WAIT, otherwise set it to NOWAIT. |
 +\\ 
 +
 +===== Examples =====
 +
 +<​code>​
 +Run_Program(%emupath%\setjoystick.exe||||NOWAIT)
 +
 +Run_Program(2||%gamepath%\cover.jpg||WAIT)
 +</​code>​
 +
 +===== Remarks =====
 +
 +When specifying the WAIT flag to pause until the executed program has finished, please note that this only waits on the program being run (as specified in the filenum/​filename parameter). If this program launches another program then immediately closes, the script will continue as soon as the first program has closed (the second launched program will not be waited on).
 +
 +===== See Also =====
 +
 +  * [[.:​run_emulator|Run_Emulator()]]
 +  * [[.:​run_emulator_send_keys|Run_Emulator_Send_Keys()]]
 +  * [[.:​run_gamefile|Run_GameFile()]]
 +  * [[.:​kill_process|Kill_Process()]]
 +  * [[.:|Script Function Reference]]
gemus_script_reference/functions/run_program.txt · Last modified: 2020/05/12 11:27 by Jimbo