Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a legacy system that is using the built in Windows commandline ftp client to upload files to an ftp server. It does this using the -s switch, with an ftp file something like the following:

open 21
cd remote_folder
lcd "c:\myfolder"
put export.txt export.tx
rename export.tx export.txt

This works 99% of the time, but the other 1% of the time it doesn't. When it runs successfully the resulting logfile contains response messages from the server like "250 OK" after each of the commands above. The problem is sometimes it seems to fail to connect then we get NO messages in the logfile (from the server or ftp client) at all. The ftp client also still seems to return a process exit code of 0.

Does anybody have any suggestions for:

Getting better logging back from the built in Windows commandline ftp client?
Forcing it to return a Process Exit Code other than 0 to indicate something has gone wrong?

share|improve this question

If it's responding to commands but failing to transfer data (uploads, downloads, directory listings) it could be that you need to enable "passive" mode. Normally FTP requires the server to be able to establish a new connection back to the client for actual data transfer. This rarely works in today's world of NAT, firewalls, and such. And when it is supported, it is actually pretty insecure (since authentication doesn't happen again on the new connection.) So passive mode flips that responsibility around and has the client establish a second connection to the server.

Try setting it in Internet Explorer's advanced setting (which affects many applications, not just IE) or check to see if the FTP client has a passive mode switch. I'm on my iPad at the moment or I'd check myself.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .