Re: Running script from scheduled task
Please read documentation:
https://winscp.net/eng/docs/scripting#hostkey
https://winscp.net/eng/docs/scripting#hostkey
"\\computername\drivename\WinSCPfolder\WinSCP.exe" /console /script="\\computername\drivename\WinSCPfolder\WinSCPscript.txt"
# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a userid, password and host
# open user:password@example.com
# Specify SFTP connection
open myuserid:mypassword@sftp.mycompany.com
# Change remote directory
cd /home/sourcefolder
# Force binary mode transfer
option transfer binary
# List files in remote directory example\
#ls
# Download file to the local directory
get *.* -delete "\\computername\drivename\targetfolder\"
# Disconnect
close
# Exit WinSCP
exit