Topic "Need to connect FTP but get "Cannot initialize SFTP protocol"

Author Message
Phoenix5ire

Guest


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~
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
You need to specify FTP protocol like:
open ftp://username:password@ftp.servername.com:21
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
For details about error message "Cannot initialize SFTP protocol. Is the host running a SFTP server?" see:
https://winscp.net/eng/docs/message_cannot_initialize_sftp_protocol
_________________
Martin Prikryl
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