Execute Process
  • 14 May 2021
  • 1 Minute to read
  • Dark
    Light
  • PDF

Execute Process

  • Dark
    Light
  • PDF

Article Summary

This is generated from the built in components of BuildMaster 7.0.0, and may be different than what you have installed (especially if you have extensions); go to [User Icon] -> Documentation within your BuildMaster instance to see exactly what operations are available.

Execute Process

Executes a process, logs its output, and waits until it exits.

Script usage:

InedoCore::Exec(
	[FileName: <text>],
	[Arguments: <text>],
	[WorkingDirectory: <text>],
	[OutputLogLevel: <integer>],
	[ErrorOutputLogLevel: <integer>],
	[SuccessExitCode: <text>],
	[ImportVariables: <true/false>],
	[WarnRegex: <text>],
	[LogArguments: <true/false>],
	[ReportProgressRegex: <text>],
	[OutputFilterRegex: <text>]
);

Arguments:

NameFormatScript UsageUsage Notes
File name
text
FileName
Arguments
text
Arguments
Working directory
text
WorkingDirectory
Output log level
integer
OutputLogLevel
Error log level
integer
ErrorOutputLogLevel
Success exit code
text
SuccessExitCode
Integer exit code which indicates no error. The default is 0. This can also be an integer prefixed with an inequality operator.
Import variables
true/false
ImportVariables
When set to true, all scalar execution variables currently accessible will be exported as environment variables to the process.
Warning regex
text
WarnRegex
When set to a valid regular expression string, output messages which are matched will be logged as warnings. To log only part of the message, use a group with name "m".
Log arguments
true/false
LogArguments
Report progress regex
text
ReportProgressRegex
When set to a valid regular expression string, attempts to parse every output message for real-time progress updates. To capature a status message, use a group with name "m". To capture a percent complete as a number from 0 to 100, use a group with name "p".
Output filter regex
text
OutputFilterRegex
When set to a valid regular expression string, only output messages which match this expression will be logged.

Example:

# execute 7zip and only succeed if the executable returns a non-negative exit code
Exec c:\tools\7za.exe (
    Arguments: i *.*,
    SuccessExitCode: >= 0
);

Was this article helpful?