I have exactly same issue except I am connecting to a sftp server. Is there any solution. Thanks
The solution for kvlt was that he was running the script in scheduler and the scheduler's system account did not have an access to the local folder.
If you use the most recent version of WinSCP, it triggers an error in such case. Older versions did not.
Thank you so much. I just realized the account privilege issue. Everything works fine now. WinSCP is fantastic. Thanks.