Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.

Put quotes around it:

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

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .