User Tools

Site Tools


gemus_script_reference:functions:run_program

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

Run_Program(filenum/filename||clp||waitflag)

Arguments

Argument Required Description
filenum/filename Yes The number of the file set in the script's 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 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 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

Run_Program(%emupath%\setjoystick.exe||||NOWAIT)

Run_Program(2||%gamepath%\cover.jpg||WAIT)

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

gemus_script_reference/functions/run_program.txt · Last modified: 2023/10/04 14:15 by 127.0.0.1