Page 1 of 1

Escaping double-quotes in command-line

Posted: Wed Sep 20, 2023 6:14 pm
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.