Re: Handling of commands that write to stderr
You can redirect the stderr to stdout:
See https://winscp.net/eng/docs/scriptcommand_call#remarks
command 2>&1
See https://winscp.net/eng/docs/scriptcommand_call#remarks