Note that the documentation covers new features and changes in beta releases 4.2 through 4.2.4 already.

Shortcut to synchronize any local directory with remote directory

You may want to have script that synchronizes any local directory with a same-named subdirectory of fixed remote path, e.g.:

  • c:\www\gallery with /home/user/www/gallery;
  • c:\documents and settings\martin\www\forum with /home/user/www/forum.

Such script is particularly useful for integrating with Windows Explorer’s ‘Send To’ menu.

First create wrapper batch file to store the paths you want to synchronize into environment variables (change /home/user/www/ to remote path root you want to synchronize against):

winscp.com /script=example.txt /parameter %1 "/home/user/www/%~n1%~x1"

The script example.txt may look like:

# Being intended for interactive session, we are not enabling batch mode
# Connect
open mysession
# Synchronize paths provided via environment variables
synchronize remote %1% %2%

Then you can make a shortcut to the batch file:

  • When placed on desktop, you can drop any local directory to it to start synchronization;
  • When placed to c:\documents and settings\username\sendto, you can use Send To > Your Shortcut from context menu of any local directory.

Further Reading

 
  scripts.txt · Last modified: 12 Sep 2009 by prikryl
 

Search

This page

Donate

Donate via PayPal

Associations

Site design by Black Gate