"Command Line App" runs a command line application. Parameter placeholders to indicate input and output files allow for seamless integration into MOVEit Central tasks.
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 Central sources, destinations, processes or next actions.
When the "[OutputFolder]" macro is used, any "[InputFile]" cache files will be 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 would not be 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 will appear in the debug log at the "Warnings" level and higher and any "StdOut" output will appear in the debug log at the "Some Debug" 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 may be run per-file or once-after-all-files. This built-in script may be run as the first step of a task.
Date macros are frequently used with command line arguments. Remember that 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 would like to run a command line application to read files passing through MOVEit Central 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 Central, Joe should...
If Joe also wanted to see any standard or error output generated by his command line application as it ran, he could also have added the phrase " > [StdOut] 2> [StdErr]" to the end of his CommandLineApp_AppPath value. This would have allowed him to see this output in his debug log: command line errors at the "Warning" level or higher and other output at the "Some Debug" level or higher.
If Joe also wanted to see this kind of output in an email or send it to another task, he could also have used the output macros "[Parm:CommandLineApp_StdOut]" and "[Parm:CommandLineApp_StdErr]".
Example #2
Nancy would like to run a command line application to process files passing through MOVEit Central. Her application will change the contents of the files if they are valid and will 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 Central, Nancy should...
Example #3
Pedro would like MOVEit Central to transfer reports created by a stand-alone command-line application. His application does not need a "source file" and will return 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 Central, Pedro should...
Example #4
Paul would like to run a command line "unzip with odd encryption" application on files passing through MOVEit Central. Each original archive file may contain one or more files, perhaps including files in archived subfolders. The syntax used by his application is "oddzip.exe -enc=codfish -ifil=(input file) -ofol=(output folder)" and her application is installed into her "D:\OddZip" folder.
To integrate this application with MOVEit Central, Nancy should...
Paul will control whether or not he wants to respect the subfolders the archive file's members were stored in in his Destination element (by checking/unchecking the "Use Relative Subdirectories" option).