0

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
2
  • If you answer my question you'll be my first acceptance Commented May 30, 2012 at 20:59
  • I don't think it's a good idea to make your pwd public... I strongly suggest changing it before somebody abuses it. Commented May 30, 2012 at 21:13

1 Answer 1

1

The send command correctly transmits a single file to the server.

In order to transmit multiple files, you may use mput instead of send.

Also, commands acting on multiple files such as mput cause prompting (y/n) - you may want to disable this by calling prompt before using mput.

Your ftpcmd.dat should look like this:

user vigftp
mypwd
ascii
prompt
mput C:\newgdrive\boldata\send\*.txt
quit
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.