Escaping double-quotes in command-line

English Support for Syncovery on Windows.
Post Reply
pavel.lechenko
Posts: 2
Joined: Mon Jan 24, 2022 4:25 pm

Escaping double-quotes in command-line

Post by pavel.lechenko »

Hi Tobias,
Our automation scripts should update Syncovery profile with ExecuteAfter scripts.

The command line for the scripts includes double-quotes characters like this:

Code: Select all

++script.bat "$LEFT" "$RIGHT" "$LOGFILE"
When I am updating the profile manually using UI everything is stored correctly:

Code: Select all

[ExecuteAfter]
xaf_test=++script.bat "$LEFT" "$RIGHT" "$LOGFILE"
But when I add using command line like:

Code: Select all

Syncovery.exe ADD /Name=test /Left=C:\left /Right=C:\right /L2R /MoveMode=mmMoveNormal /RecycleDel=No /ExecuteAfter="++script.bat ""$LEFT"" ""$RIGHT"" ""$LOGFILE""" /Mask=:+c:\WORK\111\l-r.txt /UseFolderMasks /FolderMasks=?* 
or

Code: Select all

Syncovery.exe CHANGE test /ExecuteAfter="++script.bat ""$LEFT"" ""$RIGHT"" ""$LOGFILE"""
it saves the configuration like this (without double-quotes):

Code: Select all

[ExecuteAfter]
xaf_test=++script.bat $LEFT $RIGHT $LOGFILE

Please advise how should I construct the command line and escape the /ExecuteAfter properly so it saves double-quote characters?

Thank you.

PS: We are using Syncovery 8.69f on 200+ machines.

Post Reply