I'm doing something very similar but cannot get the scheduled task to take my arguments properly.
I'm not sure where it is failing. Scheduled tasks gives no errors, just information.
The only difference is that my server listens on a port other than 22 for SSH. So, I put a :XXXX (port number) in the first command. Still no dice. I'm not sure if it is failing on the contents of the script, or failing because of the arguments.
# Connect
open sftp://<username>:<password>@123.45.67.890:XXXX -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
The only info I get from event viewer is:
Task Scheduler successfully completed task "\Get Call Recordings" , instance "{13fcf873-f123-46e6-8e80-6ce90b57638c}" , action "C:\Program Files (x86)\WinSCP\WinSCP.exe" with return code 0.
1111