Topic "Connection refused"

Author Message
mcifuentes31
[View user's profile]

Joined: 2016-04-28
Posts: 1
I am running into "The server rejected SFTP connection, but it listens for FTP connections. Did you want to use FTP protocol instead of SFTP?" error. Interestingly, I only get this error when running the commands as part of a txt file in a batch script. If I run the lines themselves I do not get the error. Example:

"C:\Program Files (x86)\WinSCP\winscp.com"
open ftp://username:password@example.com/
get /file.csv "path for save" -neweronly
exit

This works just fine, but when I run it like this:

Batch
"C:\Program Files (x86)\WinSCP\winscp.com" /script=path\FTP_Download.txt
FTP_Download.txt
open ftp://username:password@example.com/
get /file.csv "path for save" -neweronly
exit

I get the error. I want to be able to run the batch file to automate this process. New at this so sorry if the code offends you.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Please attach a session log file from both sessions.
Advertisements

You can post new topics in this forum






Search Site

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License