1

I do need that as soon as the computer is turned on, the program WinSCP starts, logs in and synchronizes a local folder with a folder on the server.

That is, there a three distinct points:

  1. Get started with Windows (I know how to do this)
  2. Log in automatically (I guess using Pageant for authentication will work)
  3. Synchronize the folder automatically

I guess that there is no way to complete all items using WinSCP GUI, so I guess that I do need use script... and it is exactly where I'm struggling!

Ooker
  • 2,051

1 Answers1

1

With WinSCP scripting, you can use the following batch file with the synchronize command:

@echo off

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^ /log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^ /command ^ "open sftp://user:password@example.com/ -hostkey=""ssh-rsa ...""" ^ "synchronize local C:\local\path /remote/path" ^ "exit"

WinSCP GUI can generate a batch file template for you.

The above uses a password authentication. If you want to use a public key authentication, use the -privatekey switch. Pageant won't help you with the automation.


With WinSCP GUI, you can use the /synchronize command-line switch like below. Though it has its limitations:

"C:\Program Files (x86)\WinSCP\winscp.exe" session /defaults /synchronize C:\local\path /remote/path