Cloud

How do I... Use the Windows Vista FTP command line utility?

<img src="http://t.cbsimg.net/i/z/200606/how_110x85.jpg" align="right" border="0" height="85" hspace="5" vspace="5" width="110" />Now that I am on my command-line kick these days, I wanted to show you how to take advantage of a free command-line FTP utility that comes packaged with Windows Vista. Why pay money for some software when you can take advantage of software you already paid for. There is no glamor and glitz or eye candy here-just straight-up hard knocks command line.

Now that I am on my command-line kick these days, I wanted to show you how to take advantage of a free command-line FTP utility that comes packaged with Windows Vista. Why pay money for some software when you can take advantage of software you already paid for. There is no glamor and glitz or eye candy here-just straight-up hard knocks command line.

This blog post is also available as a TechRepublic gallery and TechRepublic download.

Let's begin by choosing the Start orb and typing cmd in the Instant Search field as shown in Figure A.

Figure A

Type cmd in the Instant Search field to access the command line
The command line interface opens and your next step is to type ftp and then the question mark. It will give you a detailed listing of the commands available to you as shown in Figure B.

Figure B

FTP options available in the command line

Here is a simple definition of the commands (excerpt taken from http://www.nsftools.com/tips/MSFTP.htm).

  • ! - Runs the specified command on the local computer
  • ? - Displays descriptions for ftp commands
  • append - Appends a local file to a file on the remote computer
  • ascii - Sets the file transfer type to ASCII, the default
  • bell - Toggles a bell to ring after each file transfer command is completed (default = OFF)
  • binary - Sets the file transfer type to binary
  • bye - Ends the FTP session and exits ftp
  • cd - Changes the working directory on the remote computer
  • close - Ends the FTP session and returns to the command interpreter
  • debug - Toggles debugging (default = OFF)
  • delete - Deletes a single file on a remote computer
  • dir - Displays a list of a remote directory's files and subdirectories
  • disconnect - Disconnects from the remote computer, retaining the ftp prompt
  • get - Copies a single remote file to the local computer
  • glob - Toggles filename globbing (wildcard characters) (default = ON)
  • hash - Toggles hash-sign (#) printing for each data block transferred (default = OFF)
  • help - Displays descriptions for ftp commands
  • lcd - Changes the working directory on the local computer
  • literal - Sends arguments, verbatim, to the remote FTP server
  • ls - Displays an abbreviated list of a remote directory's files and subdirectories
  • mdelete - Deletes one or more files on a remote computer
  • mdir - Displays a list of a remote directory's files and subdirectories
  • mget - Copies one or more remote files to the local computer
  • mkdir - Creates a remote directory
  • mls - Displays an abbreviated list of a remote directory's files and subdirectories
  • mput - Copies one or more local files to the remote computer
  • open - Connects to the specified FTP server
  • prompt - Toggles prompting (default = ON)
  • put - Copies a single local file to the remote computer
  • pwd - Displays the current directory on the remote computer (literally, "print working directory")
  • quit - Ends the FTP session with the remote computer and exits ftp (same as "bye")
  • quote - Sends arguments, verbatim, to the remote FTP server (same as "literal")
  • recv - Copies a remote file to the local computer
  • remotehelp - Displays help for remote commands
  • rename - Renames remote files
  • rmdir - Deletes a remote directory
  • send - Copies a local file to the remote computer (same as "put")
  • status - Displays the current status of FTP connections
  • trace - Toggles packet tracing (default = OFF)
  • type - Sets or displays the file transfer type (default = ASCII)
  • user - Specifes a user to the remote computer
  • verbose - Toggles verbose mode (default = ON)

For example, let's say I am going to open my ftp server to my Web site at www.stevenscottwarren.com. I would simply type the following:

Open stevenscottwarren.com (Figure C.)

Figure C

The Open command
Next, it will ask for a user name and password. Once I enter the applicable information, I can perform a directory listing of my Web site by typing dir (Figure D).

Figure D

The Dir command

To really get started, you need to know what type of file or files you are going to receive and upload. You can transfer an ASCII text file or a Binary file. ASCII files can also be HTML files. A binary file would be a graphic files, sound, movie, Word document, etc.

For example, let's say I create a new Web page and I want to upload it to my new Web site. Here are the commands I would type in the command line:

1. Open stevenscottwarren.com

2. Enter applicable user name and password (Figure E)

Figure E

Uploading a Web page

3. Next, use the lcd command (Figure E) to change my local computer to where my Web page exists.

4. Type put tech.html. It will place the file in the public directory (Figure F).

Figure F

Public directory
5. Next, type dir to view the directory listing and you will see the file tech.html (Figure G).

Figure G

Directory listing
6. Open Internet Explorer (Figure H) and Firefox (Figure I) and type the following: www.stevenscottwarren.com/TRBlog/tech.html

Figure H

Firefox tech.html

Figure I

Internet Explorer tech.html
If you wanted to download a file, you would use the get or mget command. For example if you were going to get a graphic, (Figure J) you would type the following: Binary and get DEP.jpg (case sensitive).

Figure J

Get command
When you are finished and you type the command bye, it gives you a listing of what you have uploaded and downloaded as shown in Figure K.

Figure K

Bye command

As you can see, if you have never used the command line, there is a slight learning curve but once you get the hang of it, you can fly through the steps. Who would have thought that I would prefer the command line over a graphical user interface?

16 comments
tom.price
tom.price

This utility has been around for years. (I have NT 4 and 95 boxes that have it!) Most of the command line switches and subcommands even work in the Linux world. http://linux.about.com/od/commands/l/blcmdl1_ftp.htm If you want to feature it in an article, fine. But, its true value is in scripting (especially in scheduled scripting) and error handling becomes an important issue. Not a single scripting example was shown. Why not? Also, FTP is part of a series of useful IP stack command-line utilities. You didn't have to explain them all but they should have at least been mentioned. All in all, this article is fluff and mistitled/mistagged fluff at that. To make it really useful wouldn't have been that much extra work. I hope to see more substance in future posts.

GreyTech
GreyTech

Like rexcoxau I use the built in Windows ftp in batch files every day to do my automatic offline backup and have done for the last ten or so years. It was in windows 95 and 98 it was even available for win 3.11

karenc
karenc

quite apart from the fact that NT, 2K and XP all have an FTP command if simple tcpip services are installed you've been able to use internet explorer as a graphical ftp client since around version 4 just specify the url as ftp://username:password@www.someftpsite.somewhere:portnumber the :portnumber section may be omitted if you use standard ports so a super whizzy new feature of vista that makes us all want to lash out a couple of hundred to buy a copy and ditch a perfectly good stable copy of XP ? not really more a list of features we already have

ganymede28211
ganymede28211

Yet another topic that gives the impression that an ancient (in tech years) tool is somehow new and should be looked at as new and shiny. Yeah, the FTP utility is useful. I used it just today in fact, but WHY title it with VISTA like it's something someone just inlcuded in the VISTA OS with a "hey, let's put this in and stun the masses." Still looking for something useful.

jvhulst
jvhulst

And why use it? So many free GUI based FTP softwares around...

vincentnaert
vincentnaert

This is just the ftp command, which was in previous windows versions too? Nothing new for Vista I think...?

scottcha
scottcha

This command is there in 2000 and XP (and probably older versions as well). I don't disagree that it can be useful but don't falsely set expectations that this is something new. Give a proper title please!!! It's not the Windows VISTA ftp command line...it's the Windows FTP command.

mista.phillips
mista.phillips

Way to go Mark, nothing new! I totally agree with ganymed28211, the title of this discussion comes off as "a new and and improved vista ftp command line", meanwhile nothing has changed and it's still a P.O.S that times out like windows networking.

Mark W. Kaelin
Mark W. Kaelin

While it is true the command line has been around since the beginning and that FTP just about as long, that doesn't mean that we can't talk about them, especially when they are useful. Some readers may not realize that Windows Vista still allows command line utilities.

rexcoxau
rexcoxau

I have been using FTP within a DOS batch file for years. It can be used to automate tasks that no WYSIWYG FTP programe wil ever do. Works in WIN 2000 but never tried in WIN 98

jacobso1
jacobso1

its good ftp and command line are still there the title is wrong and give a false idea people with command-line knowledge know about it and those who do not will use only a (downloaded) gui client. poor usefullness also downloading some gui ftp clients (even freewares) make it more easy & efficient (like getting a directory and all its contents in one clik). it seems that old ms tool does not have the mget. true that IF you need ftp and cannot locate a ftp client (even your browser is dead since most browser can do ftp) then it can be used regards

larsbouwens
larsbouwens

to be honest, it is in fact a useless command... you're moving to vista but instead of using the fancy mac os interface look-a-like we all go back to using the cmd? do it the DOS way! isnt there a simple ftp program included instead of the hidden cmd?

straightp
straightp

Take a peek at "core ftp" Its a nice simple app that is spyware free and it also costs nothing... works with all flavors of windows.... look for it at download.com Hope it helps!

Steven S. Warren
Steven S. Warren

using ftp from the command line is extremely simple. If you want brainless, download cuteftp.

rgeiken
rgeiken

Just get Fire FTP for your Firefox Browser, and you can run FTP in just seconds after you get it set up, and am not going to install Firefox 3.0 until I make sure that it runs with this Add-On plus a lot of other ones I have installed. I couldn't believe how easy this program is to use. No Code knowledge required. Go to Firefox Add-ons and search on FTP, and that will get you to the add on in a hurry.

ogouninfosec
ogouninfosec

It's called Internet Explorer, and for those who don't like IE there is FTP included in Firefox too. Either one is just about as useful as the old command line FTP, none of the above is as good as a nice purpose built 3rd party FTP program though like Filezilla (also free).