Close CMD after opening multiple exe's with it ?

Current code:

cd "PATH"
cmd /c "EXE1.exe"
"EXE2.exe"

Problem:
The Command line stays open after opening the second executable.

I would need a way to open multiple programs and automatically close the command line after they have been opened.

Thanks in advance:

pasc

I don't quite understand your problem, or what your code is trying to do. From where / how are you running this?

Would adding an "exit" after the second executable help?

well for the sake of argument let's say I run it from C:/files

cd "C:/Files"
cmd /c "EXE1.exe"
"EXE2.exe"

this isn't actually a code.
Just some lines inside a bat file trying to execute two executable files.

The problem is:
The command line doing this stays open AFTER both programs have long opened.

Try putting the line 'exit' after all of those.

sadly, a exit after any and all lines will just stop the script from advancing right after the first exe file.

And 'exit' after the whole script won't do much at all either.
(it will not execute the last exit till the previous program is closed manually)

Oh, so the problem is not that it stays open, but that it doesn't return to the prompt?

That sounds pretty much like what I have got, yeah.

Try running the second command with cmd /c also.

that makes the cmd just hang there and refrain from acutally executing the second exe file.

Perhaps the first one is actually hanging, not moving to the second.

nope, that's not the case, because the second program actually opens when I don't have a "cmd /c" on it.

Now I tried this:

rem Prog1.exe
cd "Path"
Prog1.exe
Prog2.exe
EXIT

(source:http://www.sevenforums.com/tutorials/77891-batch-files-start-multiple-programs-once.html , removed the start before the ".exe"'s because it would break the whole thing.)

It now reliable opens both programs, the commandline however stays open until I close the second program by using "Alt + F4" means or by closing out regularily.

The quesition now is:
How do I get the commandline to just close out after opening those programs ?
It always waits for me to close the program till it executes the EXIT command.

Assuming you are in a Windows Command Prompt from CMD.EXE use the builtin START command...

C:\PATH> START /?<CR>
<Complete help readout here...>
C:\PATH> START EXE1.EXE<CR>
C:\PATH> _

This will start EXE1.EXE in a new shell..

EDIT:

Try this simple script and launch from a CMD.EXE shell:-

ECHO This is the calling shell...
START
START
EXIT

This will launch 2 new CMD shells and exit the calling one...

Calling this from a batch file:

START /?<CR>
START "PATH_TO_FILE\EXE1.exe"
START "PATH_TO_FILE\EXE2.exe"
EXIT

just closes the batch right away.

This one:

START "PATH_TO_FILE\EXE1.exe"
START "PATH_TO_FILE\EXE2.exe"
EXIT

Opens two command line windows that stay open (the programs I tried to launch intitially didn't launch)

Why did you use inverted commas?

*SEE* THE DIFFERENCE!!!

Manually from a Command Prompt:-

C:\ANY\PATH> START NOTEPAD.EXE<CR>
C:\ANY\PATH> START "NOTEPAD.EXE"<CR>

EDIT:

NOTE:
<CR> == Carriage Return == Return or Enter key; NOT added characters.