Re: Synchronize Script - External Command After Each File Sync?

2014-06-09 17:02

martin wrote:

using WinSCP .NET assembly...

Thanks for the reply. I don't know much (anything!) about programming .NET - is this a standalone self-contained .dll?

I can't test how it works without .NET installed as I don't have such a machine here, but this MUST be totally standalone, even runnable on XP (yes, I know!), without user prompting or installation of third party libraries. If it can't run from a USB on a "basic" windows, it's no good here.

Anyway, regarding your 3-batch-file solution: If you are calling two batch files in a sequence from a master batch file, you need to use call command, otherwise master batch file never continues after the first child batch file completes. This is a general rule (nothing to do with WinSCP). Though I do not understand what you need 3 batch files for :)

digitaltoast

Re: Synchronize Script - External Command After Each File Sync?

2014-06-08 08:40

gsidhu wrote:

Hi there,
I am wondering whether it is possible to execute an external command after each file has been synchronized

Hope I'm not thread-hijacking I'd also be really interested in exactly this as I'm trying to write a very simple "click and go" DOS script for a blind person who simply needs to sync his local folder with a remote server with ftp explicit TLS, so plain old ftp is out of the question.

I know I can make the system bell go "ding" with a special character in a batch script, and I can make soundrec.exe do something similar with a short wav file.

But what I can't figure out, despite much googling, is how to let the blind user know after each file has completed, and again when the whole lot is done. Advice appreciated!

Guest

2014-06-06 16:37

After doing some more reading, I have tried to create a third batch file which first calls the WinSCP script, followed by the second batch script. Unfortunately, when using this method, the WinSCP script executes, but the second batch does not. If this is a viable solution, any help with this method would also be appreciated.

Thanks!

Guest

2014-06-06 15:37

+Update:
I tried to create a second batch script to extract and move the synchronized files as required. Works fine when executed on it's own. However, I am now trying to have it execute automatically after synchronization has completed. I have tried to combine the two scripts into one with no luck. Any suggestions? Thanks!

Synchronize Script - External Command After Each File Sync?

2014-06-05 17:58

Hi there,
I am wondering whether it is possible to execute an external command after each file has been synchronized using the synchronize feature in WinSCP? Ie., I would like to run an unzip command if the file has been updated, and move the files to a separate, unique directory. Currently, I am using 7-Zip batch scripts to unzip and move archives, but would like to simplify it within the WinSCP script itself, if possible.
Or, if there is a means to trigger the 7-Zip batch files if a new archive has been synced, that would also be great.