Where

When

September 2017
M T W T F S S
« Jun    
 123
45678910
11121314151617
18192021222324
252627282930  

jb_logo_6_small

logo
  • Blog
  • CMake
  • Creating a Visual Studio aware console window

Creating a Visual Studio aware console window

What good is findstr without a command prompt, and what good is a command prompt that is unaware of your development environment?

When you install Visual Studio 20xx, it adds a menu item for a “devenv” (my term, not Microsoft’s) command window. That’s great, but not terribly convenient. Terribly convenient but not particularly great is the “Open command window here” context menu item in the Windows Explorer. What we really need is a devenv window that we can launch from the Explorer context menu, like this:

screenshot

You’ll need two files; A registry patch, and a batch file to massage the command window. The download link below contains the files for Visual Studio versions 2008-2013.

  • Download and expand the archive.
  • Right click on the appropriate reg file and select “merge”.
  • Place the corresponding batch file somewhere in your default system path — windowssystem32 for example.
Now when you select “Open VS20xx env window here” from the Explorer context menu, the window that opens will contain the VS development environment. Good stuff.

File contents are listed below. The Visual Studio 2010 files are shown; all others are identical except for VS version number.

 vs2010.bat
@echo off
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VCvcvarsall.bat" amd64
pushd %1
vs2010_shell.reg


Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTDirectoryshellvs2010_shell] @="Open VS2010 env window here"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOTDirectoryshellvs2010_shellcommand] @="cmd.exe /s /k vs2010.bat "%V""

Download the archive via the link below.

Print Friendly, PDF & Email