René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

FTP [windows CMD]

Automating login and specifying commands

The ftp program can be given a script to automatically login to an ftp account and execute ftp commands:
The following script logs on to a ftp server ftp.some-server.ch using the username jane and her password secret. Then it makes sure files are transmitted in ascii mode. The script cd's to /htdocs and gets index.html. bye closes the connection and exits the ftp command line programm.
C:\temp\ftp_script.txt
open ftp.some-server.ch
user jane secret

ascii
cd /htdocs
get index.html
bye
This script can then be executed like so:
C:\> ftp -n -s:C:\temp\ftp_script.txt
The -n flag supresses auto login (whatever that is?) and the -s flag (followed by a colon) specifies the script to be executed.
The script's suffix is completely irrelevant. .txt as is the case here, is not necessarly the best suffix.