# WinSCP not running through Task Scheduler

Sakshi
Joined:
Posts:
3
Location:
DELHI,INDIA

## WinSCP not running through Task Scheduler

Below script when run manually on cmd works successfully:
D:\Software\WinSCP-5.9.5-Portable\WinSCP.com /log=D:\WinSCPLog\winscp.log
open sftp://@abc.com -hostkey="ssh-rsa 2048 c2:82:7e:88:3f:ee:2b:3e:d0:04:cf:4f:3f:8c:17:d4"
lcd "BANKINTERFACE"
cd XYZ
put -nopermissions -nopreservetime DDS*.txt

When this script is run through batch file that is scheduled Task Scheduler it is not transferring.

martin
Joined:
Posts:
32,896
Location:
Prague, Czechia

## Re: WinSCP not running through Task Scheduler

This is not a script, it's a sequence of inputs.

You have to store the WinSCP commands to a script file and tell WinSCP to execute it using /script=C:\path\to\script.txt command-line switch.

See https://winscp.net/eng/docs/guide_automation

Sakshi
Joined:
Posts:
3
Location:
DELHI,INDIA

## Re: WinSCP not running through Task Scheduler

martin wrote:

This is not a script, it's a sequence of inputs.

You have to store the WinSCP commands to a script file and tell WinSCP to execute it using /script=C:\path\to\script.txt command-line switch.

See https://winscp.net/eng/docs/guide_automation

Hi Martin,
Thanks for your reply. Earlier also,the commands were saved to script file only and it worked. The only difference was WinSCP was executed in the same script file.
Now, we have separated the script and have used batch file that executes WinSCP.

Thanks for the solution. :)

You can post new topics in this forum