Fog Creek Software
Discussion Board




How To Start FTPfile.bat as a batch file


Let's says I got a file which contains
all the information to connect to a FTP file

How can I start this file automatically as a batch file ?

Snacky
Saturday, June 21, 2003

I use standard imput for FTP program:

C:\> FTP -n -v hostname  < ftp_commands.txt

ftp_commands.txt has got this form:
USER login password
CD mydir
...
GET myfile myfile.xt
QUIT

The bad thing about it is ftp_commands.txt has got a login+password info.

I do not like it, even when I make user have to pass login and password when calling to the .bat.
Then internal use of %1 %2 vars, then create the command file, then calling ftp and then deleting command file

I was not able to pass a command file to Win98 FTP *AND* ask user for login and password  without have to save them in a file. If somebody knows about it...

Ross
Saturday, June 21, 2003

Thanks. I was going to ask about this same topic.

www.MarkTAW.com
Saturday, June 21, 2003

Or use curl as someone else mentioned on a recent thread.

mb
Saturday, June 21, 2003

The solution is the -i flag.

Create a file with the commands, for example

open host
user username password
bin
get blah
put something
bye

and then do ftp -n -i < that_file.txt

Colin Newell
Saturday, June 21, 2003

One of the almost forgotten byways of traversing the net in the saturation of HTTP has been the use of email to use other protocols, such as FTP.

In the olden days, say before '92, it was common to have to use the Internet as little as possible (in my case it was because of dial up and using a KA9Q TCP/IP stack).

So virtually all the common protocols, ftp, gopher and so on, that returned data could be run by sending mail to a mail server that understood such requests.  Much like web services really.  Nothing much changes.

http://www.faqs.org/faqs/internet-services/access-via-email/

Simon Lucy
Sunday, June 22, 2003

*  Recent Topics

*  Fog Creek Home