tags:

views:

277

answers:

3

Is there any way to execute an application without waiting in Batch file. I have tried the start command but it just creates a new Command window.

+1  A: 

start is your best option; it spawns off a new process and lets the batch continue.

Example:

start winword mydoc.doc

will launch MS Word, opening mydoc.doc - without holding up the batch script.

Delan Azabani
A: 

If start can't find what it's looking for, it does what you describe.

Since what you're doing should work, it's very likely you're leaving out some quotes (or putting extras in).

egrunin
Yes, I did put two quotes. But they are required for long path name. How to resolve the issue?
Mark Attwood
Edit your question to show us the command that's failing.
egrunin
A: 

I'm making a guess here, but your start invocation probably looks like this:

start "\Foo\Bar\Path with spaces in it\program.exe"

This will open a new console window, using “\Foo\Bar\Path with spaces in it\program.exe” as its title.

If you use start with something that is (or needs to be) surrounded by quotes, you need to put empty quotes as the first argument:

start "" "\Foo\Bar\Path with spaces in it\program.exe"

This is because start interprets the first quoted argument it finds as the window title for a new console window.

Joey