Re: Stop processing if nothing to sync
You can use
https://winscp.net/eng/docs/scriptcommand_option#failonnomatch
option failonnomatch on
to make WinSCP return "error" exit code 1, when there's nothing to synchronize.
https://winscp.net/eng/docs/scriptcommand_option#failonnomatch