Automate Scripting for upload 2 files to server FTP

Advertisement

ITWEB
Joined:
Posts:
2
Location:
France

Automate Scripting for upload 2 files to server FTP

Hi,
I am a new member and user to WinSCP. I am an integrator of IT solutions and I start on WinSCP, so please excuse me if my request seems trivial and simple, she has not yet for me ;)

I want to send 2 csv files to a remote ftp server, daily via a scheduled task.

I created a txt file named TEST.txt containing the following code
open ftp://username:password@IPSERVER:PORT/
lcd D:\FTP\TEST_FTP\
cd /
put EXAMPLE.csv
exit
Then I created a bat file
"C:\Program Files (x86)\WinSCP\winscp.com" winscp.com /script="D:\FTP\TEST_FTP\TEST.txt"

it works but how to 2 csv files (same location)? Warning, in the folder FTP_TEST I have other csv files not to send so I can not use the command put * .csv

Another thing when I throw the bat I have an alert "log in using a command-line parameter is deprecated. Use the "open" command instead" but sending the csv works!

Can you help me please?

Many thanks,

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,378
Location:
Prague, Czechia

Re: Automate Scripting for upload 2 files to server FTP

Just repeat the put command:
put EXAMPLE.csv
put ANOTHER.csv
To fix the warning remove the winscp.com from your command-line, it should not be there:
"C:\Program Files (x86)\WinSCP\winscp.com" /script="D:\FTP\TEST_FTP\TEST.txt"

Reply with quote

Advertisement

You can post new topics in this forum