Selecting FTP protocol in WinSCP script

699 views Asked by At

Before scheduling script it is worth to check how it works. so from Command Prompt I have just run my batch file.

The server rejected SFTP connection, but it listens for FTP connections. Did you want to use FTP protocol instead of SFTP? Prefer using encryption.

Image:
My login window on WinSCP: Selected FTP protocol explicitly

As shown in the image above, I have specified that It is FTP file protocol. But It doesn't help.

So far I have looked up:

And It works fine on FileZilla as FTP. Therefore, I can eliminate the following possibilities:

  • Server unexpectedly closed network connection;
  • Network error: Connection refused;
  • Network error: Connection reset by peer;
  • Network error: Connection timed out.

And here is my .bat for reference:

C:\Program Files (x86)\winSCP\winSCP.com" /script="C:\test\Test.txt

And .txt:

option batch abort
option confirm off
open ***.**.**.**
lcd C:\Transfer\ToABCTest\
get -delete  /test_edi_in/*.txt
close
exit
1

There are 1 answers

1
Martin Prikryl On BEST ANSWER

You have to specify the FTP protocol in the script using the ftp:// scheme in the session URL:

open ftp://***.**.**.**