Re: move remote files with different extension to a folder and create it if not exist.
I've understand the
option batch continueif the directory already exist, and the mkdir, but I don't understand the last two commands
option batch abortand
option batch continuethe
mkdirwould succeed, even if it failed to create a (non-existent) directory.
abortmode) fails, if the folder/file does not exist. So it's a way to abort the script, if it failed to create the folder.
See also https://winscp.net/eng/docs/script_checking_file_existence#scripting