candera / shadowspawn

A Windows utility that mounts a shadow copy of the disk at a drive letter and then spawns an arbitrary command.
MIT License
184 stars 55 forks source link

error 2 always if command ARGUMENTS use quotes (to deal with spaces) #24

Closed githubuser181226 closed 3 years ago

githubuser181226 commented 3 years ago

Hi. I want to use FastCopy as a command, but ShadowSpawn always fails with error 2, unless I remove all doublequotes from the command and its arguments example:

ShadowSpawn D:\ B: "C:\Program Files\FastCopy\FastCopy.exe" /cmd=sync /exclude="$RECYCLE.BIN\;System Volume Information\;RECYCLE?\;*\thumbs.db" /auto_close /open_window B:\ /to="\backups\D"

This always ends with error 2, while this works: cd /d "C:\Program Files\FastCopy\" ShadowSpawn D:\ B: "C:\Program Files\FastCopy\FastCopy.exe" /cmd=sync /exclude=$RECYCLE.BIN\;RECYCLE?\;*\thumbs.db /auto_close /open_window B:\ /to=\backups\D

But as you can see I had to remove all quotes and values containing spaces, which is suboptimal. Any advice? Regards.

githubuser181226 commented 3 years ago

Fixed by moving quote outside the argument, ie. "/exclude=path with spaces" instead of /exclude="path with spaces".