How to write Batch Scripts

A batch file is a plaintext file or script file, which contains multiple commands to achieve a certain task. It contains a series of commands that is executed by a command line interpreter. Some basic commands of batch files:

A batch script can be used in process triggers in the Events panel of the CompleteFTP Manager, to check that the information of the events is saved in the created file in the script.

Sample code

This script checks that the Move file event works properly with a Batch script type.

:: Create a BatchScript_Result.txt file in C:\Temp which contains  information of the newly moved file
echo File '%FileName%' has been moved to another directory at %Time% > "C:\Temp\BatchScript_Result.txt"

Steps to apply the above script:

1. Go to the Process Triggers tab, and add a new process trigger for a Move file event.

2. Configure the process trigger as follows:

3. Input the above script with Batch script type, then Apply change.

4. From the FTP client, connect to the CompleteFTP server with user user1 and either move a file to another folder, or rename a file -> Ensure that the user is logged in successfully and the file is moved/renamed successfully.

5. Navigate to C:\Temp and ensure that there is a BatchScript_Result.txt file, which contains the information of the newly moved file.