batch file in dos is irregular

Come here to discuss FileZilla and FTP in general

Moderator: Project members

Post Reply
Message
Author
spikestertje
500 Command not understood
Posts: 1
Joined: 2009-01-29 10:30
First name: Paul
Last name: Spijkers

batch file in dos is irregular

#1 Post by spikestertje » 2009-01-29 10:52

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

User avatar
botg
Site Admin
Posts: 35558
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: batch file in dos is irregular

#2 Post by botg » 2009-01-29 11:33

Please configure the server and client according to the Network Configuration guide.

User avatar
boco
Contributor
Posts: 26934
Joined: 2006-05-01 03:28
Location: Germany

Re: batch file in dos is irregular

#3 Post by boco » 2009-01-29 20:30

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.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

da chicken
226 Transfer OK
Posts: 619
Joined: 2005-11-02 06:41

Re: batch file in dos is irregular

#4 Post by da chicken » 2009-01-31 16:55

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.

Post Reply