Launching Multiple Programs From A Command Prompt

  • Thread starter Thread starter WorldNet User
  • Start date Start date
W

WorldNet User

I would like to launch multiple programs from a command prompt script (in
Windows XP Home Edition). For example, I have three instant messenger
programs and want to launch them all from a script called im.bat.

So I put the following three lines into IM.bat, but launching it this way,
the script will not execute the second line until the first program is
closed.

"C:\Program Files\AIM\aim.exe"
"C:\Program Files\Yahoo!\Messenger\YPager.exe"
"C:\Program Files\MSN Messenger\msnmsgr.exe"

I tried putting start at the beginning of each line, but with that variant,
none of the three programs executed.

What needs to be done to fix this script?
 
WorldNet said:
I would like to launch multiple programs from a command prompt script (in
Windows XP Home Edition). For example, I have three instant messenger
programs and want to launch them all from a script called im.bat.

So I put the following three lines into IM.bat, but launching it this way,
the script will not execute the second line until the first program is
closed.

"C:\Program Files\AIM\aim.exe"
"C:\Program Files\Yahoo!\Messenger\YPager.exe"
"C:\Program Files\MSN Messenger\msnmsgr.exe"

I tried putting start at the beginning of each line, but with
that variant, none of the three programs executed.

What needs to be done to fix this script?
Hi

Using START should have worked, but alternatively, use a VBScript
instead.

Put this inside a file called e.g. im.vbs:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")

' Inside a quoted string, you will need to use two quotes
' to get one effective:
oShell.Run """C:\Program Files\AIM\aim.exe""", 1, False
oShell.Run """C:\Program Files\Yahoo!\Messenger\YPager.exe""", 1, False
oShell.Run """C:\Program Files\MSN Messenger\msnmsgr.exe""", 1, False
'--------------------8<----------------------


WSH 5.6 documentation (local help file) can be downloaded
from here if you haven't got it already:

http://msdn.microsoft.com/downloads/list/webdev.asp
 
Yes, the vbs script approach worked. Thank you! Not sure why the start
approach did not work.
 
It turned out that the reason the approach using start didn't work was that
with that method, it is necessary to put an extra pair of quotes prior to
the program names. Inside these quotes can optionally be the title of the
window corresponding to that program, but you can just have empty strings,
such as the following.

start "" "C:\Program Files\AIM\aim.exe"
start "" "C:\Program Files\Yahoo!\Messenger\YPager.exe"
start "" "C:\Program Files\MSN Messenger\msnmsgr.exe"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top