0

I am writing a batch file

Version 1:

"c:\Program Files (x86)\Notepad++\notepad++.exe"
start explorer .

Version 2:

start "c:\Program Files (x86)\Notepad++\notepad++.exe"
start explorer .

V1 opens notepad++ but then, alas, does not continue execution before notepad++ closes again.

V2 doesn't open notepad++ but instead opens a new command line window with the name "c:\Program Files (x86)\Notepad++\notepad++.exe", then opens explorer in my current directory.

How do I start notepad++ without blocking the execution of the next command?

2 Answers 2

2

This is well known quirk, just put empty pair of quotes as first start parameter.

start C:\MinGW\msys\1.0\msys.bat
start "" "c:\Program Files (x86)\Notepad++\notepad++.exe"
start explorer .

See http://ss64.com/nt/start.html for details.

1

The problem with the second attempt

start "c:\Program Files (x86)\Notepad++\notepad++.exe"

is known behavior. In particular:

start "bob"

will open a new CMD window with the title "bob"

The way to get your program to launch without blocking is as follows:

start c:\"Program Files (x86)"\Notepad++\notepad++.exe"
1
  • Or Just add an empty string "" after start
    – Shazvi
    May 26, 2014 at 13:37

You must log in to answer this question.

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