Script for FTP/SSH with winscp

I am looking to monitor an FTP site for files and automatically transfer them when files appear.  I use winscp as the client, and really if I can create a script of some sort that just runs at a certain time/times that would also work.  So at 5AM login to a site using winscp, copy all files from that site and then move them to a mapped drive, removing the files off of the winscp site.
Who is Participating?
Mark BullockQA Engineer IIICommented:
If your problem is simple you can do it with a single winscp command and then a delete command if the winscp command succeeds. Here's an example of a winscp command to copy a file.

If it's more complicated, here's some information about the exact same problem you want to solve. They suggest .NET. I think you could also write a powershell and probably even a .bat script.

Another option is to use cygwin (bash shell which runs on Windows) with its openssh package to get the scp command. Then you can write a simple bash shell script to copy the files. You can schedule a cygwin command in the Windows task scheduler.
Mark BullockQA Engineer IIICommented:
You can write scripts using  You can schedule a task in Windows to run every morning.

Scripting details are here. There's an example at the bottom of the page.
rhwimmersAuthor Commented:
Thanks.  After review I was given the wrong information.  A file will appear on a windows network (mapped drive or unc path) sometime in the middle of the night.  I just need to open up a connection and move (not copy) *.* from the mapped drive and put on the ssh server.  Is this still something I could use winscp for or is there a better way that you can think of?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.