3

I need to create a batch file that will open a Visual studio 2010 solution located at

C:\testProject\Test.sln file.

What I tried is

devenv.exe "C:\testProject\Test.sln"

This does not works as expected and tries to open the solution in VS2008(which is also installed in my machine).

Can anyone please let me know how to make system understand that I need to open VS 2010 and not 2008

0

4 Answers 4

4

Specify the correct path, not just the executable...

c:\xxx\xxx\xxx\devenv.exe "C:\testProject\Test.sln"
1
  • how can i add multiple of these commands ?, if i simply copy paste , it only opens the first instance.
    – N.K
    Dec 11, 2018 at 10:56
2

Add this line at the top of your batch file:

call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86

(of course, if needed, change the x86 part and the path accordingly).

1

You need to find the absolute path to Visual Studio 2010. You can do this by finding a shortcut from the desktop or start menu and right-click > properties. This will show you the path you need in your batch script. Replace denenv.exe with the absolute path.

1

use start command to open multiple instances e.g. start with : c:\xxx\xxx\xxx\devenv.exe "C:\testProject\Test.sln"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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