Did you know… How to use Visual Studio to open a file via the command line


Make sure the VS install location is a part of your path.  For example, “program files\microsoft visual Studio 8\common7\IDE” should be in your path environment variable.  Then, it’s just

Devenv.exe foo.txt

Note this will open the file using the file window layouts, which is one of the four types of window layouts we save (file, design, full screen, and debugging).

Also note that this will open the file in a new instance of the shell.  If you want VS to open the file in an existing instance, download the VSEdit Powertoy.

Happy Visual Studio’ing!

Comments (3)

  1. Sheeshers says:

    A developer working with me has configured his system to do this but I haven’t:

    Essentially, can you change some registry settings so that whenever you double click on a .dsp or .dsw file, it opens in a brand new instance of devenv instead of using an existing one?

  2. Travis Owens says:

    Sara…

    Maybe I’m reading wrong, but it looks like the VSEdit powertoy’s support for opening a file within the same VS is only within dos, is there anyway to open a file and have it use a VS that I already have open?… in Visual Studio 2003.

    This may seems a wierd behavior for .Net coding since everything is project/solution based, but I actually do a fair amount of classic .ASP coding of a pre-existing Intranet where I individually Check Out & Edit files from VSS.

  3. Norman Diamond says:

    Monday, May 16, 2005 7:25 PM by Sheeshers:

    > can you change some registry settings so that

    > whenever you double click on a .dsp or .dsw

    > file, it opens in a brand new instance of

    > devenv instead of using an existing one?

    I think Sheeshers means that for VS6 not VS.Net. I sure need that for VS6. So me too, is there any way to do that?

Skip to main content