locked
Is there a way to specify paths for saving the autorecovery information and the Start page contents?

    Question

  • Visual Studio 2010 Ultimate installed on Windows 7 Ultimate creates a folder in the user's Documents folder and saves certain information there. While some of these paths can be redirected to any other directory via the Options provided by the IDE, it seems like the following two folders are always created in the "Documents\Visual Studio 2010\" folder whenever you work with the IDE:

    1. A folder containing data for displaying the Start Page, even if you've chosen to not show the Start Page

    2. A folder containing the autorecovery data

    If you delete the folder "Documents\Visual Studio 2010\", the IDE recreates it when started. I want to keep all the related data at one place, for which I need to be able to specify the directories for maintaining the above info. Is there a way to do that, for example by editing certain configuration/XML/registry file/s? If not, this option need be incorporated!

    Wednesday, September 1, 2010 1:57 PM

Answers

  • I use an NTFS junction to overcome this limitation.

    1. Download http://technet.microsoft.com/en-us/sysinternals/bb896768

    2. Move your "My Documents\Visual Studio 2010" directory to your preferred location (eg. D:\Source\VS2010Settings)

    3. Run NTFS junction command:

    junction D:\Source\VS2010Settings "C:\Documents and Settings\<user>\My Documents\Visual Studio 2010"

    This effectively maps your preferred directory to the VS default directory.  Data is stored on D: but VS is none the wiser.

    • Marked as answer by algotechie Thursday, May 5, 2011 1:05 PM
    Wednesday, January 19, 2011 9:34 PM
  • Hi algotechie,

     

    I have consulted some expert about this issue.

    Here is the reply:

     

    I don’t believe you can change the default path to store auto recover files.  The source code always uses the user’s Visual Studio directory with “Backup Files” appended.

    For the Start Page contents, you also can’t redirect the location.   You can however specify a full URI to a Start Page XAML file.  Only when a simple filename is specified (“MyStartPage.xaml”), do we load the XAML file under MyDocs\Visual Studio 2010\StartPages.  The full URI must point to either a file (“C:\StartPages\MyStartPage.xaml”) on the local machine (network shares not allowed) or a compiled BAML resource in an assembly (“MyStartPageAssembly;component/MyStartPage.xaml”) located under the Visual Studio probing path (ex. PrivateAssemblies).

     

    The Start Page contents URI is registered under HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\StartPage\Default            “Uri”  REG_SZ.

     

    You can also register a per machine default start page URI by setting HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\StartPage\Default         “Uri”  REG_SZ.

    If there is no further question, I will close this thread, if you find something later, welcome to create a new thread, and I'll try my best to help.

    Good Luck.

     

     

    Best Regards,

    Ziwei Chen

     

    • Marked as answer by Victor_Chen Wednesday, September 8, 2010 3:08 AM
    Monday, September 6, 2010 1:54 AM

All replies

  • Hi algotechie,

     

    Thanks for your post.

    As far as I know, the path target to these two folder are determined in the hardcode, as a workaround for the backup files, you can disable the autorecover functionality, close the IDE and delete the folder, then it will not recreate when you restart the IDE.

    Hope this can help.

     

    Best Regards,

    Ziwei Chen

    Friday, September 3, 2010 6:30 AM
  • Thanks for the helpful suggestion. Unfortunately, however, the autorecovery feature is more important to me than my not wanting to see an unwanted folder in the "Documents\". So I think I'll just wait for an update/service pack that could address the issue. I'm seeing this since the Windows XP and Visual Studio 2008 days. One option's gotta be there.
    Friday, September 3, 2010 7:09 AM
  • Hi algotechie,

     

    I have consulted some expert about this issue.

    Here is the reply:

     

    I don’t believe you can change the default path to store auto recover files.  The source code always uses the user’s Visual Studio directory with “Backup Files” appended.

    For the Start Page contents, you also can’t redirect the location.   You can however specify a full URI to a Start Page XAML file.  Only when a simple filename is specified (“MyStartPage.xaml”), do we load the XAML file under MyDocs\Visual Studio 2010\StartPages.  The full URI must point to either a file (“C:\StartPages\MyStartPage.xaml”) on the local machine (network shares not allowed) or a compiled BAML resource in an assembly (“MyStartPageAssembly;component/MyStartPage.xaml”) located under the Visual Studio probing path (ex. PrivateAssemblies).

     

    The Start Page contents URI is registered under HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\StartPage\Default            “Uri”  REG_SZ.

     

    You can also register a per machine default start page URI by setting HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\StartPage\Default         “Uri”  REG_SZ.

    If there is no further question, I will close this thread, if you find something later, welcome to create a new thread, and I'll try my best to help.

    Good Luck.

     

     

    Best Regards,

    Ziwei Chen

     

    • Marked as answer by Victor_Chen Wednesday, September 8, 2010 3:08 AM
    Monday, September 6, 2010 1:54 AM
  • Hello,

    I recently changed the location of My Documents to D:\ and while I have VS2010 pointing every directory to this location, I'm still getting StartPages created on my C:\ file.  How do I get VS2010 to point this to my D:\ ?

    Thank you,

    Michae

    Saturday, October 9, 2010 1:47 PM
  • I use an NTFS junction to overcome this limitation.

    1. Download http://technet.microsoft.com/en-us/sysinternals/bb896768

    2. Move your "My Documents\Visual Studio 2010" directory to your preferred location (eg. D:\Source\VS2010Settings)

    3. Run NTFS junction command:

    junction D:\Source\VS2010Settings "C:\Documents and Settings\<user>\My Documents\Visual Studio 2010"

    This effectively maps your preferred directory to the VS default directory.  Data is stored on D: but VS is none the wiser.

    • Marked as answer by algotechie Thursday, May 5, 2011 1:05 PM
    Wednesday, January 19, 2011 9:34 PM
  • @grantph: Arguments are reversed from the goal, I believe, but the strategy works well -- thanks for the tip.
    Thursday, May 5, 2011 12:54 PM
  • The NTFS junction isn't a full solution. It is ideal if your problem is just wanting to get the autorecover files physically stored on another disk for some reason, or if you're using the DDK and need to have a project folder with no spaces in the name. But it doesn't solve the problem of cluttering your Documents folder, because the link creates a permanent shortcut there. Plus you have to learn how to use symbolic links safely if you aren't already used to them.

    So I dug into REGEDIT and found a few dozen places where the path is hardcoded. If you feel safe hacking your Registry, you can do this too. I spent 5 minutes to change the path in all these places, and it seems to be working for me as the Visual Studio 2010 folder has not returned:

    Under "HKCU\Software\Microsoft\VisualStudio" search subtree for "Visual Studio 2010" (or 2008 as appropriate).

    Under "HKLM\Software\Microsoft\MsEnvCommunityContent" search subtree for "UserDataFolder".

    Under "HKU\<Username>\Software\Microsoft" search subtree for "UserFilesFolder". Do this for every user.

    You might have different software on your system, but the above are the only places where I found paths that needed changing.

    Wednesday, July 6, 2011 2:32 AM
  • @Jason Brunt

     

    Thank you for the excellent finding. I'll do this as I get back to my dev system. I'm pretty sure it would work, maybe even after digging out one or two more places in the Registry hives. Sure does the intended job without having to resort to yet another solution in the search of a new problem. Thanks again

    • Edited by algotechie Wednesday, July 6, 2011 5:13 AM Didn't initially address the username of the original commenter and the comment box didn't align to show the nested level
    Wednesday, July 6, 2011 5:11 AM