Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Two-way synchronization with delete with SFTP/FTP server with script automation (Task scheduler)

You are on a wrong track.
That is a PowerShell script. It has nothing to do with WinSCP scripting.
You have to execute that script standalone (like from a batch file or PowerShell), not from WinSCP script.
Example of the command-line needed to run the script is given on the script article:
https://winscp.net/eng/docs/library_example_two_way_synchronize_delete
Stay_happy

Two-way synchronization with delete with SFTP/FTP server with script automation (Task scheduler)

Hello,
I want to use this https://winscp.net/eng/docs/library_example_two_way_synchronize_delete command in a script with the Windows 10 Task scheduler. But when I try it i get the error:
Script: Unbekannter Befehl „F:\...\SynchronizeTwoWayDelete.ps1“.

I want the command to automatically synchronize two folders. This should happen in the background and as efficiently as possible.

My script:
open sftp://.../ -hostkey="ssh-rsa 2048 ..." -rawsettings FSProtocol=2
ExecutionPolicy Bypass -File "F:\...\SynchronizeTwoWayDelete.ps1" -sessionUrl "sftp://...;fingerprint=ssh-rsa-...@.../" -localPath "C:\...\Neue Fotos sync both delete" -remotePath "/Camera/" -listPath "F:\...\cache.txt"
exit

I would be very happy if anybody could help me because I have been trying for many days to get it to work.

Thank you