简体   繁体   中英

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"

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"

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.

如果在资源管理器中单击文件,则会有一个start命令。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM