Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
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".

share|improve this question

2 Answers 2

up vote 4 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 
share|improve this answer
    
Thanks................... –  Tommy Jan 20 '10 at 20:10

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.

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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