Search code examples
scheduled-taskswinscp

Run WinSCP script via Task Scheduler


I have written a script to open a session WinSCP via task scheduler. My code is:

open ftpes://user:password @192.168.88.200:3688/

In Task Scheduler, I execute it by specifying:

  • Program/scripts: C:\Program Files (x86)\WinSCP\WinSCP.exe
  • on Add argument: D:\test.txt

When I trying to execute it, WinSCP opens and shows:

Host 'D' Does not exist.

I saved on script on disk D. Can you help me please with what is wrong?


Solution

  • To run WinSCP script, use /script= switch, for example:

    • Program/script: "C:\Program Files (x86)\WinSCP\WinSCP.com"
    • Add arguments: /script="D:\test.txt"

    Resources:

    You can also have WinSCP GUI generate both the script and batch file for you (or even a batch file that directly contains the WinSCP commands).