I'm looking for a batch script to automate the upload of MULTIPLE files at a time to an external ftps site (ftps://servername.xxxx.com).The files are located in a folder on a Windows Server 2008 system.If possible the batch script also needs to check if the files don't already exist in the remote folder to avoid overwrite. Many thanks.

link|improve this question
I was with you right up until the "avoid overwrite"... – Ignacio Vazquez-Abrams Jun 20 '11 at 14:42
feedback

2 Answers

WinSCP has a batch/script interface. The synchronize command appears to do what you want.

link|improve this answer
Last time I checked, this was only a feature you got if you paid the $30 for the software. Is this not true anymore? – djangofan Jun 20 '11 at 16:12
@djangofan It used to cost money? – TheLQ Jun 20 '11 at 16:14
I'm looking for a batch script without the need for installing extra software on the server itself. – ciscokid Jun 20 '11 at 16:51
@djangofan: When has WinSCP ever cost money? – afrazier Jun 20 '11 at 17:00
@ciscokid: That's probably impossible, since there's no FTPS client built into Windows AFAIK. WinSCP at least has a portable version, so that no data need be stored outside of the program folder. A VBS/PS wizard might be able to put something together (assuming there's any FTPS client functionality built into Windows at all), but it'd be a lot of work, particularly to get the "avoid overwrite" bit in place and working correctly. – afrazier Jun 20 '11 at 17:02
show 3 more comments
feedback

I would write yourself a small (less than 50 line) Java program using Apache Commmons Net utilities and then start that process in your batch file. This is the way I do it, although I currently do it via HTTPS protocol, FTPS should be doable without too much of a problem.

If it helps, and you need a rough example of this KIND of thing, I posted a blog post with my code at: http://djangofan.blogsite.org/wordpress/?p=12

link|improve this answer
Even as a Java programmer myself, that seems a little heavy and time consuming. – TheLQ Jun 20 '11 at 16:15
Indeed. Can anyone provide me with a 'simple' script that does the job as described above. If not possible without additional software, like afrazier stated, a script that can be launched through a batch file would also do. – ciscokid Jun 20 '11 at 17:15
I thought it was too ridiculous to post a giant section of code. I don't have an exact example. If you want code for my HTTPS example, I posted a link (above). You'll have to modify the example to work with FTPS. Not sure how hard that would be. – djangofan Jun 20 '11 at 22:28
feedback

Your Answer

 
or
required, but never shown

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