Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to write a Windows CMD file (for Windows 7) that will launch four instances of Visual Studio 2010 with four solutions (which make up the project I'm working on right now).

What I've tried is something like this:

@echo off
set DEVENVDIR=C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE
set CURRDIR=%CD%

rem Start solutions 1 through 4
"%DEVENVDIR%"\devenv.exe "%CURRDIR%\Solution1\Solution1.sln"
"%DEVENVDIR%"\devenv.exe "%CURRDIR%\Solution2\Solution2.sln"
"%DEVENVDIR%"\devenv.exe "%CURRDIR%\Solution3\Solution3.sln"
"%DEVENVDIR%"\devenv.exe "%CURRDIR%\Solution4\Solution4.sln"

Of course - this will happily launch Solution#1, but then it is blocked and never gets around to start up the other solutions.

So I need something like "execute those four tasks in parallel" - but in Windows CMD script... any takers??

I might also consider PowerShell, if that would make life easier... I would just like to be able to click on a single icon, go grab a coffee, and when I'm back, my four solutions would be open in Visual Studio for me.

Any thoughts, ideas?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Use the START command:

@echo off
set DEVENVDIR=C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE
set CURRDIR=%CD%

rem Start solutions 1 through 4 
START "%DEVENVDIR%"\devenv.exe "%CURRDIR%\Solution1\Solution1.sln"
START "%DEVENVDIR%"\devenv.exe "%CURRDIR%\Solution2\Solution2.sln"
START "%DEVENVDIR%"\devenv.exe "%CURRDIR%\Solution3\Solution3.sln"
START "%DEVENVDIR%"\devenv.exe "%CURRDIR%\Solution4\Solution4.sln"
share|improve this answer
    
yeah but pehaps you must do: start /d %DEVENVDIR% devenv.exe "%CURRDIR%\Solution1\Solution1.sln" –  kokbira Mar 2 '11 at 17:29
    
This is just too darn easy! :-) Why didn't I remember that START command.... I'll try it at the office tomorrow - but I'm pretty sure that's it - thanks!! –  marc_s Mar 2 '11 at 17:53
1  
@marc_s: I know! You had the answer in the rem! –  Dennis Williamson Mar 2 '11 at 17:58
    
Works like a charm !! Thank you so very much !! –  marc_s Mar 2 '11 at 20:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.