Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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, Shakehar, Tog, mpy, tombull89 Jul 18 '13 at 9:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

1 Answer

Put quotes around it:

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

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.