I want to have all folder name which is present in my library and the folder structure is like this:

Folder 1
    Sub Folder 1.1
            Sub Folder 1.1.1
    Sub Folder 1.2

Folder 2
    Sub Folder 2.1
            Sub Folder 2.1.1

Folder 3

Any help will be appreciated.

1 Answer 1



I'll refer you to an existing answer: get all document from all folder and subfolder from document library sharepoint 2010

In short, you can do a simple CamlQuery against the list for all items with FSObjType (Lookup) value of "1" but ensure you include the Scope="Recursive" attribute as part of the element. Once you have the values returned, you can build up your structure based on the URL.

Hope this helps.

  • After checking this I will get back to you Thank you for your time
    – user51831
    Commented Jun 17, 2016 at 7:33
  • I need all the folder names not the documents in it. So that is not working for me.
    – user51831
    Commented Jun 17, 2016 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.