Technical Writing Series: Internet

Using a Script to Perform FTP Functions
By Shannon Koh
Click to return to Writings Home


Introduction
This webpage is to teach you how to use a text file to execute FTP statments. Before reading this article, I assume you have knowledge of the commands in ftp.exe. If not, read the wonderful article "Using ftp.exe in Windows 95" by Angie Goh.
The Low-Down...
The command that is usually used for ftp.exe is:

ftp <ftp server address>


followed by which is a series of commands to upload your files. Imagine you as a webmaster, having to type this series of commandsover and over again, every single time you have to upload files. Tiresome? It would be if you have to do this at least a few times each week.

So why not enclose this set of commands in a script and run the script? You might be thinking: Hey wait a minute, how can I run this script? Simple. Use the -s parameter like this:

ftp <ftp server address> -s:<file that contains your script>


So What's in the Script?
Well, you will have to place ftp.exe commands inside. Here's an example.
Note: ftp.shannonkohfileserver.com doesn't exists, so don't bother to try to hack into it
.

open ftp.shannonkohfileserver.com
shannonkoh
password
put abc.html
bye

What does all these mean? Well, here's the explaination:

open ftp.shannonkohfileserver.com Opens a connection to the server that you want to connect to. In this case, it's ftp.shannonkohfileserver.com
shannonkoh A valid user ID to log into the server. In this case, it's shannonkoh.
password A valid password to log into the server. In this case, it's password.
put abc.html Upload a file called abc.html.
bye Closes a connection to the server.


Go to Top of Page
Related Articles
Using ftp.exe in Windows 95
by Angie Goh
Article that started it all. Teaches how to use ftp.exe in Windows 95
FTP Commands in a Nutshell
by Angie Goh
Provides a summary of all the commands for a simple FTP session
Other FTP Commands
by Angie Goh
Provides a summary of other useful and helpful commands in ftp.exe
FTP Glossary
by Angie Goh
Provides a glossary of the terms used in all the ftp.exe related articles


Copyright 1997 - 2002. Angie Goh c/o Angie's Life Book. All Rights Reserved.
Material written on this page is original.
Windows, DOS, Unix are copyrighted names of their various authors.
Please email if you wish to link here.
Please do not copy material here without consent.

1 1