I need to run the copy MSDOS command using the Run Command tool. Since both arguments are path objects, I need to escape them using the double quotes. To do that, I use the following Formula:
'copy /Y "' + [Source] + '" "' + [Destination] + '"'
On the output of the formula, I correctly see copy /Y "C:\...\..." "C:\---\---"
However, when I take a look at the batch file that is created on the hard drive, I see the following
Command
"copy /Y ""C:\...\...\"" ""C:\---\---\"""
As you can see, there are extra double quotes pairs which are enclosing the whole command, the source and destination paths. I have no idea why they are created.
I also tried the following
'copy /Y ' +'"'+[Source] + '"'+" "+ '"' + [Destination]+'"'
with equal effects.
The only thing that works is having no escaping, thus
"copy /Y " + [Source] + " "+ [Destination]
which produces
Command
copy /Y C:\...\...\ C:\---\---\
which, again, works but may not always do so.
I am currently on version 2021.4 and Windows 11.
EDIT: Following @mbarone suggestion, I have added colors to single and double quotes to better read the thread.