How to change the default open file dialog path

Visual Studio

Visual Studio Problem Overview


In Visual Studio (I'm using 2010) is there a way to change which folder pops up by default when you go to open a file?

Visual Studio Solutions


Solution 1 - Visual Studio

For Visual Studio 2017 and 2019 you'll have to navigate from Tools->Options (Alt+T, O) then Projects and Solutions->Locations, there are 3 Locations but you will only need to edit the Projects location and click OK. No need to restart VS.

Solution 2 - Visual Studio

There are a bunch of file locations in the registry at HKCU\Software\Microsoft\VisualStudio\10.0. The one you need to change is DefaultFileOpenLocation.

Solution 3 - Visual Studio

Yes in Tools->Options->Projects and Solutions->General

Solution 4 - Visual Studio

The only way I could configure Visual Studio 2019 Professional was through the "Developer Command Prompt for VS 2019" with vsregedit.exe as explained in this post. Adding to the windows registry didn't work.

Among the windows registry entries for VS2015 in HKCU\Software\Microsoft\VisualStudio\14.0, there used to be these:

DefaultFileOpenLocation
DefaultOpenProjectLocation
DefaultOpenProjItemLocation
DefaultOpenSolutionLocation
DefaultNewProjectLocation
DefaultNewProjItemLocation
VisualStudioLocation
VisualStudioProjectsLocation

You can change any of these keys using vsregedit. Some of these can be changed from the interface, in Tools->Options, Projects and Solutions->Locations or through the Git Settings for the Default Repository Location. The ones I had to change through vsregedit were:

DefaultFileOpenLocation
DefaultNewProjItemLocation
DefaultOpenProjItemLocation

You can read the current values with:

vsregedit read local HKCU "" DefaultNewProjItemLocation string

The output is something like:

Name: DefaultNewProjItemLocation, Value: %USERPROFILE%\source\repos

To change the values, you can use:

vsregedit set local HKCU "" DefaultFileOpenLocation string "C:\Visual Studio Projects"
vsregedit set local HKCU "" DefaultNewProjItemLocation string "C:\Visual Studio Projects"
vsregedit set local HKCU "" DefaultOpenProjItemLocation string "C:\Visual Studio Projects"

Now when we read any of the modified keys, it will show:

Name: DefaultNewProjItemLocation, Value: C:\Visual Studio Projects

Solution 5 - Visual Studio

When you click the open project button the dialog that pops up defaults to something strange, I've yet to be able to figure it out (I think it might be because I am using Dropbox). At any rate, clicking the Projects link on the left (the red arrow points to it) will take you directly to the directory you specified to put new projects in. This is Windows 7 64-bit with SP1. YMMV

Win7 Open File Dialog

Solution 6 - Visual Studio

Also works for VS 2013. Root registry key is HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0.

Solution 7 - Visual Studio

I'm using VS 2017 and was being brought to the same directory time and time again, one I had not opened for a few months despite opening and creating dozens of projects afterwards. I tried resetting via Tools > Options, but to no avail. I finally created a txt file in the directory I wanted as my default and opened that through the dialog and now it's working again.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPeteView Question on Stackoverflow
Solution 1 - Visual StudioSebastianView Answer on Stackoverflow
Solution 2 - Visual StudioMichael BeatonView Answer on Stackoverflow
Solution 3 - Visual StudioDaniel James BryarsView Answer on Stackoverflow
Solution 4 - Visual StudioMarcos DimitrioView Answer on Stackoverflow
Solution 5 - Visual StudioPeteView Answer on Stackoverflow
Solution 6 - Visual StudioALomakaView Answer on Stackoverflow
Solution 7 - Visual StudioPeter McClintockView Answer on Stackoverflow