|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (1 bit)
Join Date: Dec 2002
Posts: 1
|
Automate FTP
I am Trying to write a batch file to automatically connect to a FTP site, and copy a file to my C:\
Can anyone tell me how to do this? confused: |
|
|
|
|
|
#2 |
|
Member (9 bit)
Join Date: May 2000
Location: Lexington, Michigan
Posts: 353
|
bat file: i'll assume windows
basically you want to run the ftp command from the batch file. but you also want ftp to run a command file which contains the ftp commands you want to run here is the syntax for ftp command line: FtpTransfers files to and from a computer running a File Transfer Protocol (FTP) server service such as Internet Information Services. Ftp can be used interactively or in batch mode by processing ASCII text files. Syntax ftp [-v] [-d] [-i] [-n] [-g] [-s:FileName] [-a] [-w:WindowSize] [-A] [Host] Parameters -v Suppresses the display of FTP server responses. -d Enables debugging, displaying all commands passed between the FTP client and FTP server. -i Disables interactive prompting during multiple file transfers. -n Suppresses the ability to log on automatically when the initial connection is made. -g Disables file name globbing. Glob permits the use of the asterisk (*) and question mark (?) as wildcard characters in local file and path names. For more information, see Ftp: Glob. -s:FileName Specifies a text file that contains ftp commands. These commands run automatically after ftp starts. This parameter allows no spaces. Use this parameter instead of redirection (<). -a Specifies that any local interface can be used when binding the FTP data connection. -w:WindowSize Specifies the size of the transfer buffer. The default window size is 4096 bytes. -A Logs onto the FTP server as anonymous. Host Specifies the computer name, IP address, or IPv6 address of the FTP server to which to connect. The host name or address, if specified, must be the last parameter on the line. /? Displays help at the command prompt. pay attention to the -s command so at a command prompt your bat file would run ftp -s:c:\transfer.txt (or whatever your file name is.) in the transfer.txt file, you would have your ftp commands like: open "hostname" (or ip address) user "username" pass "password" get "name of file" exit best way to create the file is run the ftp program manually and write down the commands needed to transfer the file and put them in the text file
__________________
Certifiable =========================================== Cisco CCNA,CCDA CompTIA A+, Network+,Inet+,Security+ CIW Associate IBM AIX certified IBM Certified Specialist - p5 and pSeries Administration and Support for AIX 5L V5.3 IBM Certified Systems Expert - p5 and pSeries Enterprise Technical Support AIX 5L V5.3 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|