.execute_command Macro

This macro is used to launch executables as separate processes. It is available to execute generation commands only, and may be used in addition to standard GTL macros when defining commands.

.execute_command (cmd [,args [,mode]])

The following parameters are available:

Parameter

Description

cmd

Executable path

Type: Simple template (escape sequences ignored)

args

[optional] Arguments for the executable

Type: Simple template (escape sequences ignored)

mode

[optional] You can choose one of the following:

  • cmd_ShellExecute - runs as an independent process

  • cmd_PipeOutput - blocks until completion, and shows the executable output in the output window

Note that if an .execute_command fails for any given reason (executables not found, or output sent to stderr), the command execution is stopped.

Example:

.execute_command(notepad, file1.txt, cmd_ShellExecute)