Page 1 of 1

batch file in dos is irregular

Posted: 2009-01-29 10:52
by spikestertje
I've created a Batch file with script to retreive files from my FTP server.
This batch file runs at startup. The ftp download shows irregularity with data connections.
On several reboots of the system the batchfile completes succesfully, at other startup the script stops running;

The batch file is setup as followed:
ftp -s:update.txt
unzip -qo zipfile.ZIP -d "c:\unzipped"

update.txt
open x.x.x.x
Username
Password
prompt
literal pasv
mget \APP\*.*
mget \homedir\*.*
quit

When the batchfile isn't working correctly, I see that the server has the following line:
425 Can't open data connection.

At this moment the client will "hang" in the script file and the batch file will not continue
What can I do, so the batch file will continue after the "error opening data channel"

Thank you very much in advance

Paul Spijkers

Re: batch file in dos is irregular

Posted: 2009-01-29 11:33
by botg
Please configure the server and client according to the Network Configuration guide.

Re: batch file in dos is irregular

Posted: 2009-01-29 20:30
by boco
It may occour if you have a security app (firewall, antivirus, antimalware etc.) and the script is starting too soon. Most security apps block all ports until completely initialized. You have to delay startup of the script, with a software like Startup Delayer (http://r2.com.au/software.php?page=2&show=startdelay).

It seems you are using the Windows commandline FTP client, please note that it does not support Passive Mode at all.

Re: batch file in dos is irregular

Posted: 2009-01-31 16:55
by da chicken
boco wrote:It seems you are using the Windows commandline FTP client, please note that it does not support Passive Mode at all.
Yes, PASV mode must be supported by both the client and server. Ftp.exe doesn't have a PASV mode, so it never knows it has to initiate the data connection. It doesn't understand the server's response to the "literal pasv" command.

Please try something like wget, ncftp, or lftp.