BPSoftware.com
Home   Utilities   Purchase   FAQ   Support   Contact        
Shareware Utilities
 APrintDirect
 AIconExtract
 AFile Attribute Manager
Freeware Utilities
 AddrMon
 AFileSync
 ASysIcon
 B&P Table Utilities
 BPACLer
 BPSNMPMon
 BPSNMPUtil
 CharCount
 Delphi® Components
 MacAddr
Miscellaneous
 BPSoftware Blog
 Purchase Shareware
 Support

 


Tuesday, January 03, 2006
FTP Batch

File Transfer Protcol (FTP) is a quick way to transfer files between two computers. There are many FTP software programs, both the pay and free varieties, available. Windows® also includes a command line FTP program (ftp.exe).
In this GUI world many shutter at the thought of a command line application, however this one does have its advantages. For starters it is already included in the OS and doesn’t need to be installed. I attempt to not over complicate things and keep them clean and uncluttered. IMHO, the main advantage is the ability to process a text file that contains FTP commands. The parameter option to specify the text file to process is -s (to see the other parameter options at the command prompt type FTP -?).

This feature is advantageous because you can set up FTP batch files that perform various transfer actions without the need to click a number of buttons or type a number of commands. Login information can be included in the text file allowing access to those FTP locations that require user authentication. I have a number of batch files that I frequently use to transfer data. I have also set some up with the Windows® task scheduler for unattended processing.

A batch file could look something like this:
ftp -s:somefile.txt

In the somefile.txt file:
open 192.168.100.1
username
password

cd images
lcd images
send *.gif


The text file commands are passed a line at a time for processing. As displayed in the above example a username and password can also be passed, as those are typically the first two prompts after an FTP server connection is opened. The text file can contain any of the valid FTP commands (type ? at the ftp> prompt for a list of valid commands). I tend to be brief in my postings but hopefully you can see the value in the ability to do this. If you have any additional input I’d love to hear it.

Labels: , , , , ,

posted by Brad Prendergast at 6:32:00 PM
Comments:
While this does work most of the time, there are occasions when specific error results might be helpful. For that I suggest using Final Builder (http://www.finalbuilder.com/finalbuilder/) which has full FTP scripting and the ability to handle abnormal situations.
posted by Anonymous skamradt Wednesday, January 04, 2006 9:43:00 AM  
Links to this post:

Create a Link

Recent Posts
 Plug Me In
 Feed Me
 Santa Did Come
 Resource Basket
 Where’s my briefcase? (Part 2)
 Did you say TitleCase?
 Where’s my briefcase? (Part I)
 Delphi® and GetExplicitEntriesFromAcl
 Ode to Backup
 What's on my spreadsheet?


Labels



Archives
 October 2005
 November 2005
 December 2005
 January 2006
 February 2006
 March 2006
 April 2006
 May 2006
 June 2006
 July 2006
 August 2006
 September 2006
 December 2006
 January 2007
 February 2007
 March 2007
 September 2007
 October 2007
 November 2007
 July 2008
 November 2008
Powered by Blogger