FTP hangs


Ken Levy

I am having problems with FTP scripts "hanging".

Our script consists of a couple of "echo" commands and an command executing
the Microsoft FTP client in a .bat file.

This batch file is scheduled to execute every 15 minutes in Win 2000
Server's scheduled task list.

The output of the batch file commands and ftp script are written out to a
log file, so we can see what commands have been issued. See below for a
"sanitized" version of the log.

--- Destination Inbound FTP - Destination_inbound_ftp15.bat
--- Started -KCFILE1- Wed 09/07/2005 8:00:01.06
ftp> Connected to tws.Destination.com.

open tws.Destination.com
220 guardian Microsoft FTP Service (Version 5.0).
User (tws.Destination.com:(none)):
331 Password required for userid.

230 User userid logged in.
ftp> ftp>
Local directory now VNDRGRAF\XXXX.

CD "Pub/"
250 CWD command successful.
200 Type set to I.
ftp> GET SIMAGE_0.JPG SW_Regional_15.jpg
200 PORT command successful.
150 Opening BINARY mode data connection for SIMAGE_0.JPG(109999 bytes).
<<<END LOG>>>

The FTP task just hangs at this point, leaving the DOS box displayed. We
believe that an error in communications has occurred. Th session appears to
have timed out as a netstat command showed no sessions active when we found
the problem (about 15 minutes after the session had started).

We have tried to flush these "failures" by setting a time limit on the
execution of the scheduled task. For some reason, though, the time limit
doesn't seem to be honored and the DOS box hangs in limbo until we manually
close it. While it is hung, no new iterations of that scheduled task will

We have seen this problem with connections to both Win 2000 Server and Win
2003 Server IIS FTP servers.
The see this problem perhaps 4-5 times a week with scripts that are run 24x7
at 10 minute intervals.

My questions are as follows:

1) Is there anything I can set to force the FTP client to shutdown if the
session hangs?

2) Why isn't the "Stop the task if it runs for . . ." on the scheduled task
settings panel not honored?

3) Can anyone suggest how to make these scripted FTP transfers more

Thanks in advance for any help. Please post responses to the newsgroup.

Ken Levy


I had cross-posted it here in hopes someone might be able to shed some light
on why the FTP session hangs.
I'd rather address the root cause than trying to accommodate the error by
flushing the hung task away.

Anyone else experiencing these Microsoft FTP client sessions that stop in
mid-track and fail to complete, even when the
connection times out?


Pegasus \(MVP\)

You did not cross-post, you multi-posted. With multi-posting
you set up separate threads, and replies in one thread are
invisible to people monitoring the other threads. This leads to
duplication of effort and is wasteful.

To cross-post, place several newsgroup names into the
address field, separated by semicolons.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question