C:\adc_ftp>ftp sysadmin:ftp@localhost <----Looking for a 1 line login like this
Unknown host sysadmin:ftp@localhost. <---doesn't work
ftp> bye

This works but not how I would like to log in:

C:\adc_ftp>ftp localhost 
Connected to myPC.xxx.com.
220-FTP server
    WarFTPd 1.82.00-RC11 (Sep 22 2006) Ready
    (C)opyright 1996 - 2006 by Jarle (jgaa) Aase - all rights reserved.
220 Please enter your user name.
User (myPC.xxx.com:(none)): sysadmin
331 User name okay, need password.
Password:
230 User sysadmin logged in from host localhost (127.0.0.1)
ftp>

I'm trying to make a batch file that logs into the ftp server. I tried examples like this one, but it doesn't take the login information and just sits at the "Please enter your user name".

link|improve this question

feedback

2 Answers

up vote 3 down vote accepted

From the example that you mentioned, be sure to use the -n flag to disable auto-login

C:\adc_ftp>ftp -n -s:ftp_script.txt localhost

Where ftp_script.txt contains something like:

user
ftp
ftppassword
Some ftp commands...
quit 
link|improve this answer
Thanks................... – Tommy Jan 20 '10 at 20:10
feedback

To do this, you need to make a text file.

For instance, to get a file that is located at ftp://ftp.kernel.org/pub/README this is my text file:

open ftp.kernel.org
anonymous
root@kernel.org
get /pub/README
bye

I then call ftp using the -s parameter, like:

C:\Documents and Settings\eleven81\Desktop>ftp -s:ftp.txt

Which worked perfectly for me.

link|improve this answer
The separate txt file is what I was missing. I thought I could script opening ftp from the .bat. Thanks! (Now my bat file calls the .txt script.) – Tommy Jan 20 '10 at 20:23
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.