Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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):

open url.com
username
password
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

1 Answer 1

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:

open url.com
username
password
prompt
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.