shadowspawn icon indicating copy to clipboard operation
shadowspawn copied to clipboard

ShadowSpawn fails when robocopy uses a /log argument that includes quotes

Open dbolton opened this issue 8 years ago • 5 comments

When I include a /LOG argument with quotes ShadowSpawn gives the following error message: Error: Command line contains mismatched quotes: C:\Users\username\Documents\Backup\ShadowSpawn-0.2.2-x64\ShadowSpawn.exe "C:\Users\username\Documents\Backup\Test folder" Q: robocopy Q: "F:\Backup (Test)" /E /COPYALL /FFT /Z /XJ /ETA /LOG:"C:\Users\username\Documents\Backup\log.txt"

In this particular example I can drop the quotes and it works (because there are no spaces in the path).

However, I would eventually like to create a log in a path that includes a space (and therefore requires quotes).

dbolton avatar Aug 15 '17 18:08 dbolton

+1, i have exactly the same problem ... how to fix it please ? Why ShadowSpawn is not able to handle quotes ?

Elrick91 avatar Mar 21 '18 07:03 Elrick91

Did you try with ^" on robocopy paths? Like this: robocopy Q: ^"F:\Backup (Test)^" /E /COPYALL /FFT /Z /XJ /ETA /LOG:^"C:\Users\username\Documents\Backup\log.txt^"

Just a suggestion. I have not tried this yet, but I am thinking of using this for locked file I have to deal with. The ^ tells cmd not to interpret the quotes then instead it leaves them for the next layer to interpret the quotes; but, also removes the ^ so the next cmd layer does not see it. Here is where I got that little bit of knowledge. I used to use \" all the time. There is a better way with the ^. Anyway, I will be testing your issue next week and get back with findings.

alpauna avatar Jan 25 '19 02:01 alpauna

@alpauna Thanks for the suggestion. Unfortunately I still get the same error if I escape using the circumflex (^") or backslash (") as with the escaped double quote (").

Note, the plain double quotes work for the source and destination paths, just not the log.

dbolton avatar Jan 30 '19 21:01 dbolton

I may be way off here, but have you tried doing "/LOG:C:\Users\username\Documents\Backup\log.txt"

cseufert avatar Aug 14 '19 00:08 cseufert

@cseufert This worked for me!

wyattcroucher avatar Aug 29 '19 20:08 wyattcroucher