|
|
|
|
||||||||||||
|
ASP Kitchen: Miscellaneous Articles: Scripting the Windows FTP Client Scripting the Windows FTP ClientAlthough not strictly related to ASP or ASP.NET, here's a demonstration of how to script the Windows console based FTP client utility. This technique is useful if you want to set up a batch script to send or retrieve files to a remote server. Furthermore the technique requires no programming language other than writing a simple DOS batch script. Few people know that the Windows FTP command has a -s parameter that allows you to specify a filename containing a list of commands that the FTP command should use. So to FTP a file called default.asp from a remote server called ftp.servername.com, you would create a text file containing the following: open ftp.servername.com Note that username and password should be replaced with the username and password of an account which has appropriate access rights to send or retrieve the required files. Once the file has been saved (in this example it has been saved as FTPcommands.txt, it can be called from the Windows command line or in a batch file using the following: ftp -s:FTPcommands.txt The FTP client will then execute the specified commands... ![]() Don't forget that a full list of FTP commands available is in the Windows Help File (available from the Help button on the Windows Start menu). Look for ftp commands, overview or ftp commands, subcommands in the help index. Further reading
Author detailsBrett Burridge spent two years working in the University of Essex Computing Service, before moving to The Internet Applications Group in the Autumn of 1999, where he developed e-Business applications for a range of corporate clients and dot-com start ups. Brett is presently employed as an Internet developer and technical writer through his own company, Winnersh Triangle Web Solutions Limited. The company produces a number of innovative products, including the popular ASP Documentation Tool, Index Server Companion, .NET Documentation Tool and SQL Documentation Tool. As well as the ASPAlliance, Brett has written articles for Ariadne.ac.uk and ASPToday. Contact Brett by emailing
Article history"Scripting the Windows FTP Client" published on ASPAlliance.com on 20 February 2002. ASP Kitchen: Miscellaneous Articles: Scripting the Windows FTP Client | ||||||||||||||
| Copyright © 2000-2003 ASPAlliance.com Page Rendered at
7/23/2008 7:46:06 PM |
||||||||||||||