Batch Script (.bat)
Batch Script (.bat)
Allows you to execute a batch (.bat) script in a Windows environment.
Code
The code of the BAT script to execute. Variables can be used in this script and will be replaced before executing
REM This is a template batch file
REM Replace {file.FullName} and {file.Orig.FullName} with actual values
SET WorkingFile={file.FullName}
SET OriginalFile={file.Orig.FullName}
REM Example commands using the variables
echo Working on file: %WorkingFile%
echo Original file location: %OriginalFile%
REM Add your actual batch commands below
REM Example: Copy the working file to a backup location
REM copy "%WorkingFile%" "C:\Backup\%~nxWorkingFile%"
REM Set the exit code to 0
EXIT /B 0
Set Working File
You can update the file that will be used by the next flow element in your flow using Flow_SetWorkingFile in your batch script.
REM Rename the working file
SET NewFile=%WorkingFile:.mp4=_compressed.mp4%
MOVE "%WorkingFile%" "%NewFile%"
REM Tell the flow to use the new file
CALL :Flow_SetWorkingFile "%NewFile%"
- Only the last call to
Flow_SetWorkingFilein the script will be applied. - This allows you to rename, move, or otherwise modify files while ensuring downstream flow elements use the correct file.
Exit Codes
| Number | Description |
|---|---|
1+ | Specifies which output is to be called. Define the number of outputs using the Outputs field. This will add more output connections to the flow element. |
0 | Completes the flow successfully. This will immediately stop the flow and mark it as successful. |
other | If a number is returned that is outside the range of defined outputs, this will mark the flow as unsuccessful. |