By Doug Lowe

If you’re a command line junkie, you’ll appreciate the FTP command that comes with Windows. It isn’t pretty, but it gets the job done. In a typical session, you sign on to an FTP server (named in this example), switch to a directory (named pics in this example), download a file, and then log off.

First, open a command window: Choose Start→Run, type Command in the text box, and then click OK. Navigate to the directory to where you want to download files. This step is important because although you can change the local working directory from within the FTP command, it’s much easier to just start FTP from the right directory.

To start FTP, type ftp with the name of the FTP server as the parameter, like this:


Assuming that you typed the site name correctly, the FTP command connects to the site, displays the banner message, and prompts you to log on:

Connected to
220-Microsoft FTP Service
220 We have 999 spooks here, but there's always room for one more! To volunteer, log in as Anonymous.
User (

To log on anonymously, type Anonymous and then press Enter. The server responds by telling you that Anonymous access is allowed and asks for your email address as a password:

331 Anonymous access allowed, send identity (e-mail name) as password.

Type your email address as the password and then press Enter. The Welcome message appears, followed by the ftp> prompt:

230-Welcome to my FTP site! For spooky Halloween pictures, check out the Pics folder.
230 Anonymous user logged in.

Whenever you see the ftp> prompt, the FTP command is waiting for you to enter a subcommand. Start by entering dir to see a directory listing:

200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
06-30-07 08:05PM <DIR> pics
06-30-07 07:55PM 2365 readme.txt
06-30-07 07:55PM <DIR> sounds
06-30-07 07:56PM <DIR> videos
226 Transfer complete.
ftp: 190 bytes received in 0.00Seconds 190000.00Kbytes/sec.

As you can see, the response from the dir command isn’t quite as clean as the display from an MS-DOS command. Still, you can pick out that the directory includes three subdirectories — pics, sounds, and videos — and a single file, named readme.txt. The size of the file is 2,365 bytes.

Here’s a good question: If you enter a dir command, why does the response read 200 PORT command successful? The answer has to do with how the FTP protocol works. When you enter a dir command, the FTP client forwards a PORT command to the server that opens a data transfer port that is then used to return the resulting directory listing.

The server replies that the PORT command has successfully opened a data transfer port. Then, it sends back the directory listing. Finally, it sends two more lines: one to indicate that the transfer is complete (that is, that the dir output has been successfully sent), and the other to summarize the number of bytes of data that were sent and the data transfer rate.

The files that you want to download are located in the pics subdirectory, so the next command to issue is cd pics. This results in the following output:

250 CWD command successful.

Once again, the command’s output isn’t exactly what you’d expect. The FTP protocol doesn’t actually have a CD command. Instead, it uses a command named CWD, which stands for change working directory, to change the directory. The Windows FTP client uses command CD instead of CWD to be more consistent with the Windows/MS-DOS user interface, which uses the command CD to change directories. When you type a CD command at the ftp> prompt, the FTP client sends a CWD command to the FTP server. The server then replies with the message CWD command successful to indicate that the directory has been changed.

Next, type dir again. The FTP server displays the directory listing for the pics directory:

200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
06-27-07 10:04PM 123126 door.jpg
06-27-07 10:06PM 112457 echair.jpg
06-27-07 10:06PM 81610 fence.jpg
06-27-07 10:09PM 138102 fog.jpg
06-27-07 10:09PM 83712 gallows.jpg
06-27-07 10:10PM 166741 ghost.jpg
06-27-07 09:58PM 119859 skel01.jpg
06-27-07 10:05PM 87720 wall.jpg
226 Transfer complete.
ftp: 400 bytes received in 0.00Seconds 400000.00Kbytes/sec.

Here, you can see that the pics directory contains eight files. To download a file, you use the GET command, specifying the name of the file that you want to download. For example, to download the door.jpg file, type get door.jpg. The FTP server transfers the file to your computer and displays the following response:

200 PORT command successful.
150 Opening ASCII mode data connection for door.jpg(123126 bytes).
226 Transfer complete.
ftp: 123126 bytes received in 0.13Seconds 985.01Kbytes/sec.

Notice again that the response indicates that the command actually processed by the server is a PORT command. The file is transferred in ASCII mode. The entire transfer takes 0.13 seconds, which works out to a transfer rate of about 985K per second.

After you download the file, you can end the session by typing bye. FTP responds by displaying the site’s goodbye message; then it returns you to the MS-DOS command prompt:

221 Hurry back…

Of course, FTP is a lot more involved than this simple session suggests. Still, the most common use of FTP is to download files, and most downloads are no more complicated than this example.