Skip to main content
Version: 1.28 (Current)

Run Executable

Audience: Software Developers

Skill Prerequisites: Actions, Tokens, Automation

Starts a program on the server, waits for it to finish, and can save what it printed in a token. For example, to run command line instructions, use cmd.exe as the application.

note

This action is only available in Automation jobs, and it requires the Scripting feature to be licensed.

Typical Use Cases​

  • Run a command line tool on a schedule, for example a file sync, a backup or an import tool
  • Run a batch file (.bat or .cmd) through cmd.exe
  • Call a program that converts or processes files, and pass it file paths from tokens
  • Run a PowerShell script file with powershell.exe when you need a separate process

Don't use it to​

  • Run PowerShell code inside the application. Use Run PowerShell Script.
  • Run a program that shows a window or asks questions. The program runs without a user and can't be answered.
  • Run SQL. Use Run SQL Query.
  • Call a web service. Use Server Request.
Action NameDescription
Run PowerShell ScriptRuns PowerShell code typed into the action.
Execute ActionsCatches a failed run with its On Error actions.
Log ErrorWrites a message to the log.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
ApplicationThe program to run, for example cmd.exe. If the program isn't in the server's PATH, enter the full path, for example C:\Windows\System32\cmd.exe or C:\Tools\sync.exe.Yesempty stringYes
ArgumentsThe command line arguments, written as one line exactly as you'd type them after the program name. For example, cmd.exe with /c "echo test" prints test. Put quotes around values that contain spaces.Yesempty stringNo

Output Parameters Reference​

ParameterDescription
Output Token NameThe name of the token that stores what the program printed. Enter it without brackets, for example SyncOutput, then use [SyncOutput] in the next actions.

The token contains both the standard output and the error output of the program, line by line, in the order they were printed. It's only set when the program finishes successfully.

How the program runs​

  • Exit code. An exit code of 0 means success. Any other exit code makes the action fail. The error message includes the program, the arguments, the exit code and everything the program printed.
  • Program not found. If the program can't be started, for example because the path is wrong, the action fails with a Failed to execute process error.
  • Waiting. The action waits until the program exits. There's no timeout, so a program that never ends keeps the job running.
  • Current folder. The program starts in the web server process's current folder, not in the program's folder or your site's folder. Use full paths in the arguments, or change folder first, for example /c "cd /d C:\Tools && sync.bat".

Considerations​

  • The program runs on the web server with the permissions of the web server's account (usually the IIS application pool identity). It can read and change anything that account can reach. Make sure that account has access to the files and folders the program uses, and no more than it needs.
  • Be careful with tokens in the arguments. Token values become part of the command line. If a value can come from users, validate it first. With cmd.exe, characters such as &, | and > in a value can run extra commands.
  • Errors can show the command line. The error message of a failed run includes the full arguments and output. Don't pass passwords or keys as arguments if the error could be logged or shown.
  • Programs that expect input, or that show dialog boxes, can't be answered. Use the program's silent or unattended options.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Run a command with cmd.exe​

This action lists the files in C:\Exports and saves the list in the ExportFiles token.

{
"Title": "Run Executable",
"ActionType": "RunExe",
"Description": "List the export files",
"Condition": null,
"Parameters": {
"Application": "cmd.exe",
"Arguments": "/c dir /b \"C:\\Exports\"",
"OutputTokenName": "ExportFiles"
}
}

2. Run a sync tool with a folder from a token​

This action runs C:\Tools\sync.exe and passes it the folder stored in the ClientFolder token. If the tool exits with a code other than 0, the action fails.

{
"Title": "Run Executable",
"ActionType": "RunExe",
"Description": "Sync the client folder",
"Condition": null,
"Parameters": {
"Application": "C:\\Tools\\sync.exe",
"Arguments": "--source \"[ClientFolder]\" --quiet",
"OutputTokenName": "SyncOutput"
}
}

Revised 09/26/2026