Batch Scripting


FreeFileSync can be called from command line and supports integration into batch scripts. This section gives some general hints and examples for Windows *.cmd and *.bat scripts.


When FreeFileSync is started in batch mode (a *.ffs_batch file is passed as argument) it returns one of the following status codes:



Now you can check if synchronization was successful from a script:

"C:\Program Files\FreeFileSync\FreeFileSync.exe" "H:\some folder\SyncJob.ffs_batch"
if errorlevel 1 (
  
::if return code is 1 or greater, something went wrong, add special treatment here
  
echo Errors occurred during synchronization...
  
pause
)



Instead of displaying "An error occurred!" you can also send an email notification (using a third party tool).


Attention
Make sure your script is not blocked by a popup dialog. Consider the following options when setting up a FreeFileSync batch job: