Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For command using devenv.exe runs too quickly

So I have a command I want to run which looks like the following:

for /r %n in ("*.vdproj") do "C:/Program Files/Microsoft
 Visual Studio 10.0/Common7/IDE/devenv.exe" %n /build "BuildServer"

It seems to work in that it runs devenv on each .vdproj file; however, it seems to run them in parallel and immediately return. This is a problem; I need to wait until they are all finished before the next step in the .bat file runs. How can I either

1- Get for to 'wait' on each devenv to finish before running the next one

or

2- Wait until devenv.exe is all done before moving on afterwards?

like image 226
GWLlosa Avatar asked May 02 '12 14:05

GWLlosa


People also ask

How do I close a Devenv process?

Right click the lsiting and choose Details. Select the devenv.exe process on the details page and then click the End Task button. Confirmation window ...don you want to end this task? Click on End Process.

What is Devenv EXE?

"Devenv.exe" is the central Integrated Development Environment (IDE) for Microsoft's Visual Studio suite used worldwide to develop applications for multiple platforms in over twenty programming languages. It installs in a subfolder of "C:\Program Files", ("C:\Program Files(x86)" on 64-bit systems).


2 Answers

The trick is to use devenv.com instead of devenv.exe. devenv.com will return output to the console and achieve exactly the desired result.

like image 81
GWLlosa Avatar answered Oct 09 '22 13:10

GWLlosa


Invoke devenv.exe using start, e.g.

start /wait "" "C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/devenv.exe" %n /build "BuildServer"

Use start /? for usage.

like image 26
sorpigal Avatar answered Oct 09 '22 14:10

sorpigal