Process: Run batch file

Execute a batch script file and capture its output.

Help Centre › Building Processes

Execute a batch script file and capture its output.

Add it to a process

In the process designer, open the Add step tab. Find Run batch file under Process, or type its name in the search box, and drag it onto the canvas.

Fields

FieldRequiredWhat it does
File pathYesEnter the file path, or use a variable such as {folders::desktop::path}\file.txt.
Output variableNoName of the variable where the result will be stored
Exit-code variableNoVariable to store the exit code, for branching on success
Full-result variableNoVariable to store the full result object (stdout, stderr, exit code, duration)
Timeout (seconds)NoSeconds to wait before the script is stopped (default 60, 0 for no limit)
Working directoryNoWorking directory to run the script in
Environment variablesNoExtra environment variables for the script
Window styleNoConsole window style (Windows only) Choices: Normal, Hidden, Minimized, Maximized.
Fail on non-zero exitNoFail the step when the script exits non-zero (default true)
Run as AdministratorNoExecute the batch file with elevated administrator privileges. Default: off.

What it gives back

  • {variable} – The script's output
  • {exit_code_variable} – The script's exit code
  • {result_variable} – {command, stdout, stderr, exit code, pid, timed out, duration, succeeded}

See all Process steps.

Errors

ErrorDescription
File not foundThe batch file does not exist
Permission deniedInsufficient permissions to run the file

Tips

  • Executes a .bat or .cmd file
  • Enable Run as Administrator for system-level commands

Related functions

Get started

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or have your first automation working in 7 days.