Need to connect FTP but get "Cannot initialize SFTP protocol

Advertisement

Phoenix5ire
Guest

Need to connect FTP but get "Cannot initialize SFTP protocol

I'm using WinSCP v4.0.4 (b346), automating a script download to a non-secure (port 21) FTP connection and this is what I'm getting, any help is greatly appreciated. I'm running this on Windows 2000. My script is as below:
=========================================================================
option confirm off
option transfer binary
open username:password@ftp.servername.com:21

# Get files
get *.* "c:\directory\foldername\"
rm *.*

#Disconnect
close

exit
=========================================================================
=========================================================================


This is the error I get:

C:\Program Files\WinSCP>WINSCP.COM /script=test.TXT
confirm off
transfer binary
Searching for host...
Connecting to host...
Host has not answered for more than 15 seconds. Still waiting...
Warning: Aborting this operation will close connection!
(A)bort:
=========================================================================

Now, if I Abort and it takes me thru the manual login input, here what I get:
.....
C:\Program Files\WinSCP>WINSCP.COM /script=test.TXT
confirm off
transfer binary
Searching for host...
Connecting to host...
Host has not answered for more than 15 seconds. Still waiting...
Warning: Aborting this operation will close connection!
(A)bort: Abort
Terminated by user.
winscp> open
Host: ftp.servername.com
Searching for host...
Connecting to host...
Authenticating...
'ftp.servername.com' session username: username
Using keyboard-interactive authentication.
Password:
Authenticated.
Starting the session...
Connection has been unexpectedly closed. Server sent command exit status 1.
Cannot initialize SFTP protocol. Is the host running a SFTP server?
winscp>
=========================================================================

As stated above, the host is not running an SFTP server. This is just a regular FTP connection. Now, if I use the WinSCP interface to connect, I have no problems it connects just fine and I can see everything. But I need to automate this download with a script, is there a setting in the script that I need to turn off SFTP protocol? What am I doing wrong?

Thank you in advance!

Phoenix~

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,517
Location:
Prague, Czechia

Re: Need to connect FTP but get "Cannot initialize SFTP protocol

You need to specify FTP protocol like:
open ftp://username:password@ftp.servername.com:21

Reply with quote

Advertisement

You can post new topics in this forum