I have a MOSS site where there is many folders and subfolders. I would like to output this folder hierarchy e.g. into a text file. How is that possible? Windows command line "tree" command does not work with UNC paths? Here is a desired example output from my local computer:

│   ├───revprops
│   │   └───0
│   ├───revs
│   │   └───0
│   ├───transactions
│   └───txn-protorevs

3 Answers 3


tree \\server\sitecollection\site works fine for me (Windows XP)


Alternatively, DO NOT USE FOLDERS/SUBFOLDERS in a SharePoint doc lib. Yes, it works. No, it is NOT the preferred way to do things. Metadata (custom columns) is by far a better way to manage your docs and what they are. Category/SubCategory = Folder/SubFolder. Makes finding/sorting/filtering your docs much easier and faster. And you can trivially export that info out as a CSV/Excel/Text.

Try it.

  • I think the question is about the underlying folder structure of the install, not folders within libraries.
    – e100
    Nov 13, 2010 at 13:40

You're better off doing this with an export to Excel, with a couple extra steps to show the folder structure. It's very easy. Check out my article on LinkedIn:


  • Answers must contain all information for the answer in the answer itself. It should not be necessary to follow a link to learn the answer, and promoting your own content in this way is just in bad taste. Feb 14, 2021 at 17:02
  • Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.
    – DavidPostill
    Feb 14, 2021 at 17:30
  • Welcome to Super User! Please note if you want to promote or recommend your own product/blog, there are some guidelines in place for doing so. Following them will help you avoid giving the impression that you're spamming. Could you please edit to explicitly state your affiliation? Thanks.
    – DavidPostill
    Feb 14, 2021 at 17:31
  • Before answering an old question having an accepted answer (look for green ✓) as well as other answers ensure your answer adds something new or is otherwise helpful in relation to them. Here is a guide on How to Answer. There is also tour Feb 17, 2021 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.