Command Line App
- Last Updated: April 25, 2025
- 4 minute read
- MOVEit Automation
- Version 2026
- Documentation
The Command Line App runs a command line
application. It contains parameter placeholders to indicate input and output files.
When custom scripting is disabled, the Command Line App script is disabled.
For more information about disabling custom scripts, see Disable custom scripting.
Input Parameters
- CommandLineApp_AppPath (Required) - Specifies the full path of the command line application to run.
- CommandLineApp_AppParms - Specifies the parameters passed into the command line application. Use the special macro [InputFile] to indicate the name of the file against which the command line application should execute. If you expect the command line application to write new output use either [OutputFile] for a single output file or [OutputFolder] to indicate an output folder (which can include multiple files and subfolders). Pipe output to [StdOut] and [StdErr] macros to have this information displayed in the system log and in parameters for later use.
- CommandLineApp_AltReturnCodes - By default, a return code of "0" indicates success. You can use this parameter to add or change the return code or codes that indicate success. Each values must be separated by a comma. For example, if the values "3,27,52" are applied to this parameter, each of the three return codes signal success. If the return code of "0" is removed from the parameter, it no longer indicates success.
Notes
The "[InputFile]", "[OutputFile]", "[OutputFolder]", "[StdOut]" and "[StdErr]" macros used with this built-in process are not available for general use in other MOVEit Automation sources, destinations, processes or next actions.
When the "[OutputFolder]" macro is used, any "[InputFile]" cache files are ignored in the final output. For example, if CommandLineApp was used to run "unzip.exe [InputFile] -d [OutputFolder]", the Zip file indicated by the "[InputFile]" parameter is not included in the set of files sent to the destination.
To record any "standard" or "error" output written by your command line application, append the following phrase to your usual CommandLineApp_AppParms value. > [StdOut] 2> [StdErr] For example, if your original CommandLineApp_AppParms value is "a c:\windows\system32\eula.txt", you can record output with a revised CommandLineApp_AppParms value of "a c:\windows\system32\eula.txt > [StdOut] 2> [StdErr]". Any "StdErr" output appears in the system log at the "Warnings" level and higher and any "StdOut" output will appear in the system log at the "Some System" level and higher. To use the first 8192 characters of each type of output in your Next Actions, use the related "[Parm:CommandLineApp_StdOut]" and "[Parm:CommandLineApp_StdErr]" output parameters.
This built-in script can be run per-file or once-after-all-files. This built-in script can be run as the first step of a task.
Date macros are frequently used with command line arguments. Operators (such as the minus sign) normally apply to all times and dates in a macro phrase. To apply operators to only part of a macro phrase, use double-quotes to delimit phrases.
For example, if today is currently July 5, 2007, a macro of:
- [dd][mm-][yyyy] [dd][mm][yyyy] yields 05062007 05062007
- "[dd][mm-][yyyy]" [dd][mm][yyyy] yields "05062007" 05072007
Example #1
Joe wants to run a command line application to read files passing through MOVEit Automation and make sure they contain valid data. His application will NOT change the contents of the files. The syntax used by his application is "checkapp.exe -verify (input file)" and his application is installed into his "C:\Program Files\VerifyIt" folder.
To integrate this application with MOVEit Automation:
- Create a new task with a source, process, destination and schedule.
- Select "Command Line App" as the process
- Set process parameters:
- CommandLineApp_AppPath = "C:\Program Files\VerifyIt\checkapp.exe"
- (Add) CommandLineApp_AppParms = "-verify [InputFile]"
To see any standard or error output generated by the command line application as it ran, add the phrase " > [StdOut] 2> [StdErr]" to the end of the CommandLineApp_AppPath value. This shows this output in his system log: command line errors at the "Warning" level or higher and other output at the "Some System" level or higher.
To see this kind of output in an email or send it to another task, use the output macros "[Parm:CommandLineApp_StdOut]" and "[Parm:CommandLineApp_StdErr]".
Example #2
Nancy wants to run a command line application to process files passing through MOVEit Automation. Her application will change the contents of the files if they are valid and return a non-zero error code if the files are not valid. The syntax used by her application is "alterapp.exe -x207 -i=(input file) -o=(output file)" and her application is installed into her "D:\AlterProg" folder.
To integrate this application with MOVEit Automation:
- Create a new task with a source, process, destination, and schedule.
- Select "Command Line App" as the process.
- Set process parameters:
- CommandLineApp_AppPath = "D:\AlterProg\alterapp.exe"
- (Add) CommandLineApp_AppParms = "-x207 -i=[InputFile] -o=[OutputFile]"
Example #3
Pedro wants MOVEit Automation to transfer reports created by a stand-alone command-line application. His application does not need a "source file" and returns a non-zero error code if it cannot create its reports. The syntax used by his application is "makereports.exe -repcode=76 (output file)" and his application is installed into his "C:\Program Files\DBExtracts" folder.
To integrate this application with MOVEit Automation:
- Create a new task with a process, destination and schedule. (No source).
- Select "Command Line App" as the process.
- Set process parameters:
- CommandLineApp_AppPath = "C:\Program Files\DBExtracts\makereports.exe"
- (Add) CommandLineApp_AppParms = "-repcode=76 [OutputFile]"
Example #4
Paul wants to run a command line "unzip with odd encryption" application on files passing through MOVEit Automation. Each original archive file can contain one or more files, and might include files in archived subfolders. The syntax used by his application is "oddzip.exe -enc=codfish -ifil=(input file) -ofol=(output folder)" and the application is installed into the "D:\OddZip" folder.
To integrate this application with MOVEit Automation:
- Create a new task with a source, process, destination and schedule.
- Select "Command Line App" as the process.
- Set process parameters:
- CommandLineApp_AppPath = "D:\OddZip\oddzip.exe"
- (Add) CommandLineApp_AppParms = "-enc=codfish -ifil=[InputFile] -ofol=[OutputFolder]"
To control whether to respect the subfolders in which the archive file's members were stored in the Destination element, check or uncheck the Use Relative Subdirectories option.