Topic "SFTP Batch authenticating but not performing actions"

Author Message


C:\Program Files\WinSCP\WinSCP.exe /console /command "option echo on" "option batch abort" "option confirm off" "open s" -hostkey="ssh-dss 1234 65:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" "ls " "cd /DropOff " "put c:\uploadfile.txt" "exit"

The process successfully creates a session, but it doesn't execute the ls, cd, put or exit. The console stays upon with the session active. I am able to then manually enter the ls, cd, put and exit commands manually and the file transfers.

Is there something that I need to do to make the actions execute automatically.

I've spent a number of hours on and I can not seem to figure out what I'm doing wrong.

All ideas are greatly appreciated.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26858
Location: Prague, Czechia
C:\Program Files\WinSCP\WinSCP.exe /console /command "option echo on" "option batch abort" "option confirm off" "open s -hostkey=""ssh-dss 1234 65:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" "ls " "cd /DropOff " "put c:\uploadfile.txt" "exit"

Note the quotes around -hostkey switch.
Martin Prikryl


Thank you for correcting my syntactical error. Everything is working as you designed it to work.


You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License