Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you send multiple files using ftp.exe?

How do you send multiple files of the same file extension?

I tried using "mput", as the help for ftp.exe says that command is for sending multiple files, but I cannot figure it out, and I cannot find any official ftp.exe documentation.

I specifically want to send all of the text files in a single directory. Here is what I tried (it only sends the alphabetically-first text file in the directory):

cd Test
mput X:\*txt

This is the batch that calls the above text:

ftp.exe -s:name_of_text_file.txt
share|improve this question
Not a direct answer, but ftp.exe doesn't get much love on Windows as so few use it. Can you use the command-line version that comes with winscp? – uSlackr Aug 6 '12 at 23:02
What is happening? Nothing is getting uploaded? – Canadian Luke Aug 7 '12 at 20:34
up vote 1 down vote accepted

you have it almost right. The only missing bit is prompt, which toggles interactive mode on/off. So it should be:

cd Test
mput X:\*txt

share|improve this answer
I am pretty certain there needs to be a backslash("\") after the partition name in line 6. Otherwise, it just looks in the directory of the script itself. Also, your change did not work for me. I tried "prompt", "prompt off", and "prompt on". Still no joy. – nairware Aug 6 '12 at 23:58
about backslash - it was just a byproduct of markup, sorry. I have not noticed it got eaten. Prompt is just that - no on, off or anything else. What happens after first file is sent? You're left at ftp command prompt after script runs, so it should either copy all your files or ask you for each. Unless you redirect output, which you have not shown. – wmz Aug 7 '12 at 0:34
I am left with a cmd.exe window sitting open. The output from ftp, starting at the prompt part, goes as follows: prompt >> Interactive mode Off . >> cd Test >> 250 CWD successful. "/Test" is current directory. >> put X:\*txt >> 200 Port command successful >> 150 Opening data channel for file transfer. >> 226 Transfer OK >> 16 bytes sent in 0.xx seconds. It ends with my cursor still in the ftp prompt, inside cmd.exe. – nairware Aug 7 '12 at 1:56
>> put X:\*txt - that means you use put instead of mput! The effect will be just as you described - one (first expanded) file will be sent. Inspect your script, probably you have few versions of it and use incorrect one – wmz Aug 7 '12 at 10:16
yep, you got it. Somehow I never ended up with mput and prompt in the same file during my testing. Thanks. – nairware Aug 7 '12 at 13:59

You must log in to answer this question.

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