Take the 2-minute tour ×

This question already has an answer here:

I am writing a batch to call a .exe file which is made by C#. However, the C# program reads one of the parameters incorrectly.

Here's my code in the batch file:

start "" "example.exe" %cd% para1

However, when the %cd% (current directory of the batch file) path contains spaces, my C# exe will read the argument wrongly by shifting one argument.

Is there a way to set %cd% as one argument or other way to fix this problem?

share|improve this question

marked as duplicate by Karan, Shekhar, Tog, mpy, tombull89 Jul 18 '13 at 9:06


1 Answer 1

Put quotes around it:

start "" "example.exe" "%cd%" para1

share|improve this answer
