WINSCP: task scheduler not working but is working when executed from winscp console?

1

1

I have been trying to run a task scheduler named "Backup" that downloads the specified file from the FTP server to my local directory.

When I executed the command manually from the winscp console it worked but did not work in task scheduler. I have no errors shown but it gives a 0x1 code and in the history says

Task Scheduler successfully finished "{152e054b-1562-4544-af06-d6c75f9e97b1}" instance of the "\Backup" task for user "domain\user".

The script action was:

Program/script: C:\Users\ID\WinSCP\WinSCP.exe 

Add arguments (optional): /command "winscp /script =C:\myScripts\testScript.txt"

user318059

Posted 2014-04-24T14:22:40.953

Reputation: 11

Answers

0

The command-line arguments that you have specified do not make any sense.

It looks like you are trying instruct WinSCP to run WinSCP. That cannot work.

Use only this:

/script=C:\myScripts\testScript.txt

I.e. this is an equivalent to specifying the following full command on Windows command-line (you should test this before trying it from scheduler):

C:\Users\ID\WinSCP\WinSCP.exe /script=C:\myScripts\testScript.txt

See WinSCP command-line documentation.

Martin Prikryl

Posted 2014-04-24T14:22:40.953

Reputation: 13 764