Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review



It turns out it was probably related to the Windows Scheduled task. I completely removed the task and set it up again and it is now working (no changes have been made to the script or to the commands used as parameters).

It may also have been an issue with permissions for the service account used to schedule the task. The script was not to blame however.


Re: Script has stopped working

The script uses some obsoleted commands (like option transfer), but all of them are still working in the latest version of WinSCP.

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Script has stopped working

I've been using a generic 'put' script with WinSCP for years and not had any issues. The below script has stopped working, however, and I cannot find the reason why. The scheduled task outcome appears to state that a command is incorrect:

# 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 to the session in WinSCP (defines folder locations)
open HousingPartners
# Force binary mode transfer
option transfer binary
# Upload file with the mask to the remote directory
put "HHExtract*.xlsx"

# Exit WinSCP

This script was previously working fine with this scheduled task, but appears to have stopped working some time in the last 4 weeks. I had a similar task that also stopped working around the same time, however this appeared to be an issue with permissions on a suppliers SFTP server which has now been resolved. I've also double checked that the session name is correct.

Has one of the commands been deprecated or something?