Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the start command in a batch file?

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?

like image 543
AngryHacker Avatar asked Jun 19 '13 21:06

AngryHacker


People also ask

How do I make a batch file start?

To create a Windows batch file, follow these steps: Open a text file, such as a Notepad or WordPad document. Add your commands, starting with @echo [off], followed by, each in a new line, title [title of your batch script], echo [first line], and pause. Save your file with the file extension BAT, for example, test.

What is start command in CMD?

In computing, start is a command of the IBM OS/2, Microsoft Windows and ReactOS command-line interpreter cmd.exe (and some versions of COMMAND.COM) to start programs or batch files or to open files or directories using the default program.

How do I run a batch file from the command line?

Open the folder containing the batch file. Right-click the batch file and select the Copy option. Use the Windows key + R keyboard shortcut to open the Run command.


1 Answers

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.

like image 157
Magoo Avatar answered Sep 20 '22 16:09

Magoo