Command line passing quotes within quotes

user2617566 picture user2617566 · Dec 10, 2013 · Viewed 22.7k times · Source

I've been searching for a solution to this but couldn't find one. Not sure if its possible.

Can I pass into command-line execution that passes a in a bat file which has an input file as its arguments?

So from the command-line it'll look like this:

C:\run.exe "C:\space folder\run.bat "C:\space folder\input.txt""

The problem is with the folders that has spaces so the quotes are required to be in there.

Answer

Jorge Campos picture Jorge Campos · Dec 10, 2013

Try this:

C:\run.exe "C:\space folder\run.bat \"C:\space folder\input.txt\""

And here is a link that you can see all escape characters http://www.robvanderwoude.com/escapechars.php