We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

problem with FTP using command prompt [Answered]RSS

4 replies

Last post Jul 15, 2009 03:49 PM by robmcm

  • problem with FTP using command prompt

    Jul 06, 2009 11:49 AM|chrisduff|LINK

    Hi there

    I have a very strange issue, I am trying to FTP to a remote server ( Win2003 server) using command prompt. I can connect to the machine, it accepts my credentials, now if I do a ls command, command line just hangs and nothing happens. If I fo a "put" it it seems to hang as well. If after that I check the directory on the server where I did the "put" I can see that the file is created but it has 0 bytes.

    I have this problem ONLY whithin our office network, and the problem only occures with command prompt. If I use a third party tool like filezilla it works fine, I can also FTP using IE

     Also the command prompt method, works fine when used Outside our network.

     We checked our Antivirus, network firewall log and nothing is being stopped - we even created a rule for a particular machine so everything was opened to it and still not joy

    The Firewall on our server didn't deny anything either.

     Any advice are welcome as we have a number of application which runs scripts using DOS to ftp files to our site.



  • kehand kehand

    70 Posts


    Re: problem with FTP using command prompt

    Jul 06, 2009 12:17 PM|kehand|LINK

    Hi Chris,

    It's likely that you need passive mode enabled to connect to your FTP Server. Filezilla makes the switch automatically for the user. To do this in the ftp.exe client on Windows, try (without the double quotes):

     "quote pasv"

     That should switch you into passive mode. Please let us know if this does not resolve the situation.



  • Re: problem with FTP using command prompt

    Jul 06, 2009 01:06 PM|ServerIntellect_BH|LINK

    That sounds about right.

    Command Prompt uses Active mode by default.

    As you are able to log in (port 21), but not issue commands, it would seem you are not able to establish the Data connection which, using active mode would mean you would have to have a random port open on your firewall to connect to the server's data port of 20.

    As FileZilla uses PASSIVE mode by default, it is able to connect to the server on a random port, instead of forcing the port to be open on your firewall, to establish the data connection.

    Brock Hensley
  • Re: problem with FTP using command prompt

    Jul 07, 2009 10:10 AM|chrisduff|LINK

     Thank for replying,

    I tried with "quote pasv" but it didn't work. Also I can use command prompt to FTP to my server with any machine outside my network. It only fails whithin the network.

    When i say fails, in fact it connects, create the file on the remote server but doesn't transfer the data. I end up with a 0 byte file.



  • Re: problem with FTP using command prompt

    Jul 15, 2009 03:49 PM|robmcm|LINK

    While "quote pasv" will actually send the PASV command over the wire, the ftp.exe command-line program is not actually capable of passive communications, so I would expect it to continue to fail.

    For command-line operations I would suggest switching to the MOVEit Freely command-line secure FTP client that I discussed in this blog, which can do both passive and FTPS communication:




    Robert McMurray [MSFT]