I now have to execute the same transfers but to sites with different ftp details. I don't want to schedule a new windows task for each transfer so i was wondering if there is a way to execute other ftp.txt files from the main ftp.txt file that is triggered from the command line?
If that is not possible could i just run several ftp batch files from a single command line command.

1 Answer
1

Scripting functionality of WinSCP does not support any control sequences, manipulation of file paths, etc. If you need these, you have to call WinSCP script from a wrapper script implemented in another scripting language (like VBscript). Any language which supports COM/ActiveX can be used.

I think i may have found a simpler way. I should just be able to extend the ftp.txt file i have. Replacing "bye" with "close" and then starting another ftp session straight after, this way i can use different ftp details and upload the files in different places.
–
Tom smithAug 19 '13 at 21:36

True. But you can also use Scheduler to call single batch file, which would then launch all the required FTP sessions. Such approach will be easier to manage, it may also allow you to launch concurrent sessions with 'start' command, were there such need and the files large.
–
Michał SacharewiczAug 19 '13 at 22:14

Have in mind that FTP automations typically need some error checking. A linear script either works or fails. If you start dozens of scripts, it could be very hard to find what went wrong. Another potential problem is security. The FTP protocol transmits passwords in clear text without encryption. That can be avoided using SFTP.
–
Axel KemperAug 20 '13 at 6:32