27

I have a batch file that starts an app with a lot of command-line parameters:

"C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\11.0\WebDev.WebServer40.exe" /port:1672 /path:"C:\Code.Net\My App\Iteration 6\REL_6.8.806_PerfEnhanceV\Fusion\Code\CC.Fusion\CC.Fusion.Services" /vpath:"/FusionServices"

The problem is that when I run the batch file, the DOS window stays up until the command completes and I would like it to go away. So I tried using the start command, but placing it in front, like this:

start "C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\11.0\WebDev.WebServer40.exe" /port:1672 /path:"C:\Code.Net\My App\Iteration 6\REL_6.8.806_PerfEnhanceV\Fusion\Code\CC.Fusion\CC.Fusion.Services" /vpath:"/FusionServices"

But I get an error stating that Invalid switch - "/port:1672"

I have also tried escaping the double quotes, but I was not successful.

How do I fix that?

3
  • How do you kick off the batch file? Do you invoke it from the Command Prompt?
    – jimbo
    Jun 19, 2013 at 21:22
  • @jimbojw No, just double click on the file. Jun 19, 2013 at 21:42
  • 2
    Have a look at - ss64.com/nt/start.html.
    – Royi
    Jan 17, 2019 at 9:09

2 Answers 2

68

An extra pair of rabbits' ears should do the trick.

start "" "C:\Program...

START regards the first quoted parameter as the window-title, unless it's the only parameter - and any switches up until the executable name are regarded as START switches.

0
10

I think this other Stack Overflow answer would solve your problem: How do I run a bat file in the background from another bat file?

Basically, you use the /B and /C options:

START /B CMD /C CALL "foo.bat" [args [...]] >NUL 2>&1
1
  • 1
    That question is for calling other batch files asynchronously. Unfortunately it doesn't solve my specific problem. Jun 19, 2013 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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