The FTP Command-Line Client

Windows Server 2012, as in previous versions of Windows, includes a command-line FTP client that can be effectively used to diagnose issues with the FTP service. Because the command-line client echoes each command and response, diagnosing the response codes is easier than with other FTP clients, including Internet Explorer, which may not show accurate return codes. Return codes are discussed in the next section.

The default syntax for beginning an FTP session with the command-line client is simply:

ftp {ServerName}

You can designate the server by name or IP address, and, if needed for a nonstandard port, append the port address with a colon. The default launching of the FTP client, when followed by a server designation, assumes an open command for that server. If you merely launch the FTP client by typing ftp and pressing Enter, you will find yourself at the FTP command prompt without an open connection.

The most commonly used FTP commands are open, close, dir, cd, get, put, and quit. The open and close commands will open or close a connection to the FTP Server specified as a parameter for the command, respectively. The dir command simply displays a directory at the level you are at within the FTP folder hierarchy, and the client also supports the UNIX-style ls command to list directories and files. The cd command enables you to change directories, the same as on the local system at a command prompt. The get and put commands are used to get a file from ...

Get Professional Microsoft IIS 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.