Wednesday, December 15, 2010

Command Line ready for VS2010

At times you want to do stuff from the command line with visual studio. The first action is often to run vsvars32.bat which injects all the environment variables the visual studio tools need. You might consider doing that globally, but this turns out to be a very bad idea if you work with different version of Visual Studio.
Because like any real programmer I hate doing repetitive stuff, here's what I came up with. Put a shortcut to the command line window on desktop and open properties. The actual program called is found in Target


As it turns out cmd has a nice set of command line switches as you can see here (for windows XP but things still work the same way in Windows7). So I altered the properties of my shortcut to

C:\Windows\System32\cmd.exe /k "%VS100COMNTOOLS%vsvars32.bat"

Which gives you the following result

If you set the 'Start in' to something meaningful for you, you're ready for take-off with no effort!!!

No comments:

Post a Comment