Commandline FTP in Windows XP
FTP (File Transfer Protocol) is a system that has been implemented with a wide variety of user-interfaces, all of which fundamentally perform the same set of tasks: copy a file from some other computer to your own, copy a file from your computer to some other one, and a set of miscellaneous tasks that help facilitate the copying. This document is intended for use as an overview of FTP in general, using the commandline FTP interface that comes pre-installed with the Windows XP operating system.
- Opening commandline FTP
- Changing directories
- Getting a file
- Putting a file
- Deleting a file
- Closing FTP
-
Opening commandline FTP
To open an FTP session, click on your Windows "Start" button, and select "Run." You will be prompted to specify the program you would like to use. Type "ftp ftp.sonic.net" and click "OK" to start your session immediately.
You will be prompted to provide your Sonic.net username. Type in your Sonic.net account name (without "@sonic.net" at the end), and hit enter.
You will be prompted to provide you password. Please note that the FTP interface will not "echo" this, so you will be shown no indication of what you have typed for your password. As always, Sonic.net passwords are case sensitive.
Note: email-only accounts do not have full access to our FTP server. If you do not have the password for your parent account, you can still download some files by using the username "anonymous."
-
Changing directories
FTP servers use a directory structure, with individual files stored inside directories, some of which are contained by parent directories. Navigating the directory structure uses the "cd" command. To navigate to the "/pub" directory, type "cd /pub" and hit enter. The FTP server should return a "250 CWD command successful" code (example).
Sometimes it is useful to confirm which directory you are currently in. To do this, type "pwd" and hit enter. (example).
-
Getting a file
To copy a file from the remote server to your own computer, use the "get" command. Many files are "binary" files, such as images, audio, and video. We recommend issuing the "bin" command first to avoid corrupting the contents of the file you are transferring. To issue this command, simply type "bin" and hit enter. The FTP server should return a "200 Type set to I" code (example).
To ensure that you are downloading precisely the right file, it is useful to obtain a listing of the files in your current directory. Type "ls" and hit enter. The FTP server shoudl return a listing of all the files in your current directory (including subdirectories), then a "226 Transfer complete" code (example).
The command to get a file is simply "get." Type "get filename" and hit enter to start copying. The FTP server should return a "150 Opening BINARY mode data connection for filename" code upon beginning the transfer, and a "226 Transfer complete" code upon completion. This will be followed by a summary of how many bytes were transferred, the amount of time the tranfer took, and a measure of how fast the transfer was (example).
If you would like the file you are receiving to be written to a particular directory on your computer, you can use the syntax "get filename localdirectory" (not including the local directory will result in the file being placed in a default directory, typically C:\Documents and Settings\your Windows XP account name\").
-
Putting a file
To copy a file from your computer to the remote server, use the "put" command. As with the get command, many files are "binary" files, such as images, audio, and video. We recommend issuing the "bin" command first to avoid corrupting the contents of the file you are tranferring. To issue this command, simply type "bin" and hit enter. The FTP server should return a "200 Type set to I" code (example).
The command to put a file is "put." Type "put filename" and hit enter to start copying. The FTP server should return a 150 Opening BINARY mode data connection for filename" code upon beginning the transfer, and a "226 Transfer complete" code upon completion. This will be followed by a summary of how many bytes were transferred, the amount of time the tranfer took, and a measure of how fast the transfer was (example).
If the file you were copying to the server was not located in your default directory, it will be necessary to specify the full path. This will looksomething like "put C:\directory\subdirectory\filename." You can determine the full directory path that precedes the filename in Windows by opening the folder that contains it and looking for the "address" bar near the top of the window.
-
Deleting a file
From time to time it is necessary or desirable to remove a file from the remote server. To do this, type "delete filename" and hit enter. The FTP server should return a "250 DELE command successful" code (example).
Note: Sonic.net maintains snapshot backups of files on our system, but you should generally consider the "delete" command to be permanent and irrevocable. Please maintain backups of all your important files.
-
Closing FTP
When you are finished, you can exit FTP by issue the command "bye." Simply type "bye" and hit enter. The FTP server should issue a "221 Goodbye" code and return you to your Windows commandline or your desktop, depending on how you initially opened the FTP program (example).



