I have a batch file that runs every night in which it ftps a file over. In that batch I have this line echo send C:\send*.txt>> ftpcmd.dat. This works perfectly when there is only one file in the send folder and I only want to send one file the newest one, but when there are numerous files sometimes it sends the newest one sometimes it doesn’t. Im not sure what determines what file is sent when I use a ‘*’ as the filename.
@echo off
echo user > ftpcmd.dat
echo psswd> ftpcmd.dat
echo ascii>> ftpcmd.dat
echo send C:\newgdrive\boldata\send\*.txt>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat ftp.thinktbl.com
del ftpcmd.dat
The
sendcommand correctly transmits a single file to the server.In order to transmit multiple files, you may use
mputinstead ofsend.Also, commands acting on multiple files such as
mputcause prompting (y/n) – you may want to disable this by callingpromptbefore usingmput.Your ftpcmd.dat should look like this: