You can set custom commands to be executed before and after synchronization on this property page.
Enter the full path name of a local file of type, .exe, .cmd, .bat, or .ps1, to be executed before starting the synchronization process. You may also optionally enter the command line argument below this path name field.
You may optionally enter the command line argument here to be passed during execution. The following internal variables are available in the command line argument. They will be replaced by their respective values before executing the command.
Select this option to abort synchronization in case the command fails, i.e., it returns a value greater than zero.
Select this option to wait for the command to complete before starting synchronization.
Enter the full path name of a local file to be executed after the synchronization process is over, with or without success. You can also provide optional arguments for this command below.
Select this option if you want to execute the above command only on successful completion of synchronization.
Select this option if you want to execute the above command only if there is some error completing the synchronization process, i.e., it was not successful.
You can use the above feature to run external commands before or after the synchronization process, like mounting and dismounting of encrypted container files. For example, the following PowerShell scripts can be used to mount and dismount a BitLocker encrypted VHD file. The mount command will be the full path name of the "mount-vhd.ps1" script file with the argument as "-p MyPassword full_path_name_of_vhd_file", while the dismount command will be the full path name of "unmount-vhd.ps1" script file with the argument as the full path name of the VHD file.
mount-vhd.ps1:
unmount-vhd.ps1:
For synchronizing to a VeraCrypt container file, you can use the full path name of "VeraCrypt.exe" as both a pre-task and a post-task command for mounting and dismounting the container. The arguments for mounting and dismounting the container will be "/m rm /nowaitdlg /q /s /p MyPassword /v full_path_name_of_veracrypt_container_file" and "/nowaitdlg /q /s /d {MrRoot}" respectively. You should also select "Abort on failure" and "Wait for completion" options for mounting, i.e., for the pre-task command.