1
votes

I am trying to transfer multiple files through FTP from a local directory - C:\Users\Documents\FTP\*.* to the Domain.

I've approached like the below.

First I've created a batch script DISCH.BAT as below ::

open ftp://[email protected]/outbound/Pre/Release/ 
USERNAME 
PASSWORD 
binary
mput C:\Users\Documents\FTP\*.*
quit

I've created another batch file RUN.BAT as below :

ftp -i -s:C:\Users\Desktop\DISCH.bat

When I am running the RUN.BAT ie., the second one, nothing is happening. Can you please advice where I am going wrong.

Thanks in advance.

1
How do you run it? Did you run it from console window (cmd.exe) so that you can spot any errors? - Martin Prikryl
Though if you are trying to run a command-line ftp client from your C# application, instead of native C# code, it's a really bad solution: stackoverflow.com/q/44669001/850848 - And you did respond neither to my comment nor the answer yet! - Martin Prikryl
I am running it directly... Double clicking RUN.BAT - METALHEAD
So no wonder you cannot see what went wrong. Test it in the console. Or add pause at the end of the batch file. But anyway, you first have to fix the problem I have shown in my answer. - Martin Prikryl

1 Answers

1
votes

The argument to open is not URL, but only a hostname:

open XXX.XXXXXX.net

To enter the desired folder, use cd command after the credentials:

cd /outbound/Pre/Release/