views:

3027

answers:

3

I'm trying to replace the programs that run from my startup directory with a batch script. The batch script will simply warn me that the programs are going to run and I can either continue running the script or stop it.

Here's the script as I have written so far:

@echo off
echo You are about to run startup programs!
pause 

::load outlook
cmd /k "C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE" /recycle
::load Visual Studio 2008
call "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"

Both of these commands will load the first program and wait until I close it to load the second. I want the script to load the processes simultaneously. How do I accomplish this?

Edit: When I use the start command it opens up a new shell with the string that I typed in as the title. The edited script looks like this:

start  "C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE"
::load Visual Studio 2008
start "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"
+2  A: 

There is the start command that will behave much like if you clicked the files in Explorer.

Carl Seleborg
Cool, this worked but I didn't research the start command enough to notice the /b switch and the argument list, thanks.
Trevor Abell
+4  A: 

This works:

@echo off
echo You are about to run startup programs!
pause 

::load outlook
start /b "" "C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE" /recycle
::load Visual Studio 2008
start /b "" "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"
Romulo A. Ceccon
+3  A: 

Use START like this:

START "" "C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE"

When your path is enclosed in quotes, START interprets it as the title for the window. Adding the "" makes it see your path as the program to run.

aphoria