I'm trying to execute a command with git-bash using cmd. I need to pass the command for it to execute. The problem is I need to pass the path of the batch file into the command and it has spaces. I can't seem to be able to pass quotes to "cmd" in a way that it will understand it.
cmd //C "c:\Program Files (x86)\another path\file.bat args && echo done"
That will give me an error:
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
If I try using single quotes then it passes a literal backslash to cmd.
cmd //C '"c:\Program Files (x86)\another path\file.bat" args && echo done'
Which will give me the error the same error but show the backslashes:
'\"c:\Program Files (x86)\another path\file.bat\"' is not recognized as an internal or external command, operable program or batch file.