0

I'm running a batch file that calls a script from a text file but it's not retrieving the files I want.

DownloadData.bat

ftp -v -i -s:FTPscript.txt 192.168.50.50

FTPscript.txt

username
password
lcd "c:\temp"
cd /Downloads
pwd
binary
mget "*.csv"
disconnect
bye

Result

C:\temp>ftp -v -i -s:FTPscript 192.168.50.50
User (192.168.50.50:(none)):

ftp> lcd c:\temp
Local directory now C:\temp.
ftp> cd /Downloads
ftp> pwd
257 /Downloads/ is the current working directory.
ftp> binary
ftp> mget "*.csv"
Cannot find list of remote files.
ftp> disconnect
ftp> bye

What am I doing wrong? This may be irrelevant but I am running this script off a virtual machine using windows 10 hyper-v. The VM is windows 7.

edit 2021-05-14--- Couldn't figure it out so I am using winSCP instead which is working. Thanks for the responses everyone!

1
  • 1
    If you have a "solution", please post it as an answer, instead of editing the qeustion. May 14, 2021 at 20:25

1 Answer 1

2

mget "*.csv" might be failing for these reasons:

  • There's no .csv files in the remote Downloads directory.

  • Permission issue - the FTP user doesn't have read or list permissions on the remote Downloads directory.

  • You have a strange FTP server that's not responding to the FTP protocol LIST or NLST request with something Windows ftp expects, or your FTP server doesn't support wildcard filenames.

You must log in to answer this question.

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