Just create a batch file that connects and uploads a file to all hosts sequentially.
With WinSCP scripting the batch file can be like:
@echo off
set UPLOAD=winscp.com /command "open %%1%%" "put ""%1""" "exit" /parameter
%UPLOAD% ftp://martin:password@server1.example.com/home/martin/
%UPLOAD% sftp://user:password@server2.example.com/home/user/
Now you can call the batch file (say multiupload.bat
) with a file path as an argument:
multiupload.bat c:\path\upload.txt
You can even drop/link the batch file in Explorer's "SendTo" folder to easily use it from the Explorer's "Send To" menu:
Some references:
- Guide to automating file upload to SFTP server
- A practical example for upload to a single host
- Making the script take name of file to upload as parameter to easily reuse it.
- Example for creating parametrized script to upload files:
- Creating entry in Explorer's "Send To" menu.