Selecting FTP protocol in WinSCP script

可紊 提交于 2019-12-23 02:39:05

问题


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:

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:

  • https://winscp.net/eng/docs/message_server_rejected_sftp_listens_for_ftp
  • https://winscp.net/eng/docs/ui_login

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:


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

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


来源:https://stackoverflow.com/questions/41383261/selecting-ftp-protocol-in-winscp-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!