"Command Line App" runs a command line application. It contains parameter placeholders to indicate input and output files.
Input Parameters
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:
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:
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:
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:
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:
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.