Macro Command Help

RUNPROG

 

Macro Command Name

Menu Path

Link to Command Table

RUNPROG

Access via macro or menu only

Click here

 

Introduction

Run any external process from a macro, such as a batch file or executable

How to use

An example use is as follows:

!runprog $exprog#=MyProgram.exe

!if $exprog#=0, then

!echo ERROR: Program file $program_file# not found

!endif

MyProgram.exe is the program you wish to execute.

The environment variable $exprog# will be set to zero or 1 depending on whether the program is found.

The macro will wait until the program has finished running before continuing its own processing (it is not asynchronous).

The external program can be placed in the project folder or any folder that is referenced in the Datamine environment. See the Datamine.env file for details.

 

Process Arguments

The RUNPROG process can be used in a macro to run any external process program or file. It can be supplied with arguments. Examples include running batch files or executables.

RUNPROG can allow the target file to be supplied with arguments.

An example use is as follows:

!runprog $exprog#=MyProgram.exe arg1 arg2

!if $exprog#=0, then

!echo ERROR: Program file MyProgram.exe not found

!endif

MyProgram.exe is the program you wish to execute.

The environment variable $exprog# will be set to zero or 1 depending on whether the program is found.

The program or target file name must NOT contain any spaces. Any text after spaces is treated as an argument.

The macro will wait until the program has finished running before continuing its own processing. (It is not asynchronous).

The external program can be placed in the project folder or any folder that is referenced in the Datamine environment. See the Datamine.env file for details.