I have looked at the answers already provided, but I'm still stuck. Here is what I currently have:
start "" "C:\Program Files (x86)\Spark\Spark.exe"
echo Spark started
This works fine. But now I want to pass parameters to the client, which must be wrapped in quotes. I can do the following on the command line:
"C:\Program Files (x86)\Spark\Spark.exe" "user=%USERNAME%&server=example.org"
And it starts up with the user and server fields filled in.
But when I try to edit the batch script to add those quote-wrapped parameters, I get a variety of errors depending on how I try to add double-quotes and where, etc.
So how would I add a quote-wrapped parameter to the start line?
Update:
I accidentally got it to work, but haven't been able to reproduce it. But it didn't work exactly right. The user name was still blank, but the server was filled in. I forgot to mention that I am using an environment variable for the user name: %USERNAME%
So it might be my problem is that I can't escape quotes and use environment variables?
Final Answer:
It turns out that part of the problem was that I was using the wrong parameter, but originally I had been using the right one, so I didn't notice. From the command line, I should have:
"C:\Program Files (x86)\Spark\Spark.exe" "username=%USERNAME%&server=example.org"
and so from the batch file, the following works:
start "" "C:\Program Files (x86)\Spark\Spark.exe" "username=%USERNAME%&server=example.org"
echo Spark started
Much thanks and points to dcp for getting me to the right answer.