Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a very simple Windows-XP batch file:

Sleep 3
Sleep 5
Sleep 11

Of course, I don't want to have to exit each program, before the next one starts. The default for batch files seems to be "stop until the previous program exists".

The three executables listed above are program like Notepad: They open and run and don't just "open, run, close".

How do I get this script to run as expected?

share|improve this question

Another suggestion: If you are putting your program in quotes because there are spaces in the path to the exe, you need to do this:

start "" "C:\myPath\myApp.exe"

Found it here: Run Windows application from Command Prompt

share|improve this answer

Use the Start command. Change your batch to this:

Start Program1.exe
Sleep 3
Start Program2.exe
Sleep 5
Start Program3.exe
Sleep 11
share|improve this answer
All that START did was to continue opening more and more DOS windows... and never running any of my .exe programs at all. – Sandy Dec 26 '10 at 20:08
I find that odd. Looking at your edit, are these GUI type programs that don't have a console? If you run notepad.exe from the Console, it will not block the console from continuing. – vcsjones Dec 26 '10 at 21:04
@Sandy: sounds like there is a line break between "Start" and the program name?! or maybe you have " " around the program name? if so, remove them – Felix Dombek Dec 27 '10 at 2:50
Having the same problem and removing the quotes doesn't make it work either. – Chris Charabaruk Dec 28 '10 at 19:13
do these apps open? is it perhaps a path issue? – datatoo Dec 30 '10 at 13:09

Try using JScript instead. Create a file called run_programs.js that looks something like this:

var objShell = new ActiveXObject("WScript.Shell"); "Program1.exe",  1, false); "Program2.exe",  1, false); "Program3.exe",  1, false);

Then change your batch file to simply execute the script, e.g.

cscript //I //E:Jscript run_programs.js
share|improve this answer

You must log in to answer this question.

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