FolderBrowserDialog Will Show "My Recent Documents' By Default

Posted on 2007-10-06
Last Modified: 2012-05-05
I have recently included a BrowseFolderDialog control to my app. During testing I noticed it would open up to the "My Computer" directory by default.

To test the functionality of the control I changed the root folder to "recent"
Me.FolderBrowserDialog.RootFolder = Environment.SpecialFolder.Recent

After running the program to see what I would get, I then changed it back to "My Computer"
Me.FolderBrowserDialog.RootFolder = Environment.SpecialFolder.MyComputer

What I wanted to do was to open the control in a specific directory. I've sense learned that in order to get the control to show a specific directory what I needed to do was to  type in the directory I want to in to the "SelectedPath" property.
Me.FolderBrowserDialog.SelectedPath = "c:/mydirctory".

However, the problem is every since I specified the RootFolder to be "recent", if I do not specify a specific RootFolder the control will open up in the "My Recent Documents" Directory. I.e setting the SelectedPath does nothing and I must choose some other RootFolder setting to get it to open in another folder other than "My Recend Documents" directory.

I have set FolderBrowserDialog.RootFolder to several different settings, I have rebooted numerous times and I have searched the registry for "RootFolder" (and found nothing). Nothing I have tried will change it from trying to open the "My Recent Documents" directory (unless I specify another RootFolder like "My Computer").

What I want is to open a specific directory when the control opens and not something from the "RootDirectory" property.

Any ideas on why it is stuck on "My Recent Documents" directory?
Question by:Asparona
    LVL 8

    Expert Comment

    I replicated your sequence of steps. Unlike your case, if I do not specify the root folder, it opens up in My Documents by default.

    Can you post your code for a closer look?

    Accepted Solution

    Thanks for your response.

    I took a closer look myself before replying and I was able to test a bit more.  I have found that one problem is the control will not navigate to the "My Documents" folder on my computer. It appears to be related to the path having spaces in it. I can navigate deeply in the directory tree (e.g. "C:\Inetpub\wwwroot\BOI\Production merchant site\images\_vti_cnf") so long as the directory names do not have spaces in them.

    When i try to navigate to the 'My Documents" folder it fails (e.g. "C:\Documents and Settings\firstname lastname\My Documents"). I assuming it is related to so many directories with spaces in the name.

    So, when it couldn't navigate to the directory it defaulted to the "recent" directory. By specifying "My Computer" as the RootDirectory I can get it to default to an acceptable directory  (when it can't get to the  directory I specify).

    This has resolved my problem or answered why it wasn't working as expected.

    Thanks for your input.


    Author Comment


    Yes I resolved the question myself. Can you refund the points?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now