Selecting FTP protocol in WinSCP script

2019-06-01 07:40发布

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条回答
一夜七次
2楼-- · 2019-06-01 08:00

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

open ftp://***.**.**.**
查看更多
登录 后发表回答