Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a Windows Batch Script to Startup Multiple Files

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"
like image 541
Trevor Abell Avatar asked Nov 13 '08 18:11

Trevor Abell


2 Answers

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"
like image 161
Rômulo Ceccon Avatar answered Nov 03 '22 00:11

Rômulo Ceccon


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.

like image 30
aphoria Avatar answered Nov 03 '22 00:11

aphoria