Visual-studio – How to force Visual Studio 2008 to use an Open instance when double clicking a file

visual studiovisual-studio-2008

Certain non-project files that I use Visual studio for (.build, .xml, free-roaming html and css files) are already associated with visual studio and open in it when i double click them.

How can I get them to open in an existing instance of visual studio? Right now If i double-click the same file twice, it will open two instances of visual studio, I'd like it just to basically ignore the second open attempt if there is already an instance of VS open.

Best Answer

Windows 7 vs2010 answer;

Because "Default Programs > Associate a file type or protocol with a program" is so useless, use regedit.

Navigate to HKEY_CLASSES_ROOT\VisualStudio.XXX.10.0\shell\Open\Command and add /edit to the end of the open with line, where XXX is the filetype you wish to affect.

Example .reg file for .cpp;

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\VisualStudio.cpp.10.0\shell\Open\Command]
@="\"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\devenv.exe\" /dde /edit"