Subscribe
Notify of
guest

77 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Walter Lord Charest

Interesting tutorial and outcome. Nice job in showing each step along with a screen grab explaining the steps taken. Learned something….Nice job….WLC

Nathan

Is there any way to automatically save the output file to a different location than the folder you are trying to map?

Codrut Neagu

Sure. Use the command tree /a /f > "d:folderoutput.txt" and change d:folder with where you want to save your output file.

Peter

Hi, I used this and it did produce the output.doc file. However, it is blank. I am using a work network, where windows explorer is patched (somehow) to Sharepoint. Is this why it is not showing a directory?
Thanks for this article – very clear and helpful.

Sylvia

Hi there, awesome job, it works beautifully! Could you please let me know how I can add the last modified date of the files to the exported tree? Which prompt do I need to give instead of tree /a /f > output.doc ? Thanks!

Okaro

I Have too many files in other languages (japanese, spanish, etc..) but in the file are saved with questions marks:

+—(2008.01.01) AKB48 – SET LIST ~?????????? 2006-2007~
| | | | 01. ??????.flac
| | | | 02. BINGO!.flac
| | | | 03. ?????????.flac
| | | | 04. ????.flac
| | | | 05. ?????.flac

Any way to fix it?

Thanks.

Binary Man

You should try: Directory Report
It can handle files which contain international characters
http://www.file-utilities.com

Sav

Is there any way to plant a virus or steal data from running a directory tree with no saved file request? Other than a listing of all the files on the computer, is there any sensitive data in the directory itself?

jamie

for a non computer savy person, this was an easy to understand tutorial. Thank you.
Unfortunately, when I followed the instructions, the doc produced only the text “too many parameters.” So, for that non computer savy person, what does this mean and how do I do what y’all were able to do? 😉

F Stein

Awesome! Thank you so much for this easy tutorial and trick! Just what I needed. Now if only I could get the output format to look nicer…

Ciprian Adrian Rusen

Thank you for appreciating our work. Don’t hesitate to subscribe to our newsletter, for the latest tutorials and articles that we publish.

K

Perfect solution, thank you!

Akhil V N

is there any way get tree structure only up to first 4 layers

Kevin

My aim is to get all this info. into an xlsx file – how do I do this

david

open up excel, then open up the saved file tree file that was created. you’ll have to delimit it or spend hours formatting based upon how large of a file you have. I’m dealing with roughly 13,000 lines right now and i can’t see an easy way to go about it.

Anonymous

I want the same!

david

Thanks for the help!! Any assistance with formatting in Excel? Delimiting,etc…

Liviu

Nice life hack ! 🙂

promytius

great except I just want folder names, the TREE, not the file names.
Thanks though, nice process.

stst415

I wanted the same thing. This tutorial gave me a good start… but then I googled the “tree” command and found that all we need to do is REMOVE the /f and it will indeed create the tree without the file names. It worked perfectly.

A Helpful Person

When I tried this, I had to run cmd as administrator. I also did a tree of ALL of my C: drive, so I don’t know if that is why.

A Helpful Person

I wanted to tree all of my C: Drive on windows 10. To do so, I had to run the Command Prompt as admin. If you get an “Access Denied” message, open the start menu and type “cmd”. Right click and select “run as admin”. Then you’ll have to manually navigate to the desired location. Hope this helps.

Dan

Does not work for UNC Paths. Local computer only.

Paul

does this have the 255 char limit on paths and filenames?

nickons

you saved my weeks 🙂 big help.

Question – can we save this into an excel file instead of word or txt file?

Fabi

How can I do this but have the comments that are attached to the files also be exported?
I have a folder with images scanned from 35mm slides and the file comments have the information that were on the sleeves of the slides. is there a way to export those?
Thank you

John

Thank you for this great tutorial! However, when my output document doesn’t list the folders in the right order. A number of our sub-folders are named things like ’01 XXXX,’ ’02 YYYYY, ’03 ZZZZ,’ etc. The output document lists them in a random order (’03 ZZZZ,’ and then ’01 XXXX’). Is there a way to get the tree to match the exact order of the folders as seen?

HH

Thanks so much for this.

Andrew

This trick saved my butt on a work project. Thank you so much for posting it!

Anonymous

Happy to help. Do not hesitate to subscribe to our newsletter, for more useful content.

Sandra

I tried this and it used to work really well. Now I only get 1 page of the full print out. Once I got 5 pages, but that was only half of the total folder. What am I doing wrong?

Tina

Thank you very much for this information. I just want to know what is “/a /f” for and would it be possible to get more information, e. g. save dates and file sizes.

Gokul

Is it possible to do this the otherway around (create the directory structure from the doc)?

EverythingIsDataIsEverything

thanks for putting it together, very helpful

Seth Thomas

This is absolutely wonderful and everyone at work is loving this especially when trying to find files or folders. Is there any good way that you know of that you can trace a line of folders/subfolders more effectively?

That is the only tedious amount.

Thanks!

Hugo

What I need is to show the only tree of folders and not included the files.

Thank you very much!

John Gow

just omit the /f
ie >tree /a > output.txt

Jason Darrell

Worked like a dream, thank you. Well, almost. Didn’t quite capture the names when I exported the .txt to a .csv, but it provided a good enough template for my music library. Only 500 directories and 8,000 songs to sort through now – wish me luck! And thanks again xxx

Anonymous

Glad to help. Do not hesitate to subscribe to our newsletter, for more useful tutorials like this one.

Roger

I received this in the newsletter this morning. There are comments dating back years???
I’m a book collector (ebooks) so I tried the FolderTree.exe file on my books folder. I have a 31,000 line text file listing all my books! A neat list but I really don’t know what to do with it.
In html format the list could be used to remove outdated books from my library but I don’t know if that’s even possible? What’s the possibility of your Powershell programmer coming up with an exe file that produces the list in html format?

Michael

Try Snap2HTML

https://www.rlvision.com/snap2html/about.php

It’s freeware, and produces really neat HTML listings of folders and files

Roger

Thanks Michael, that app produces a nice html list from an EPUB list but it adds an unnecessary step to opening an ebook.
There are Extensions available for Edge that open Epub and PDF files and maybe other ebook formats so I open an ebook directly from my folder tree
I was looking for a use for Codrut’s list when I suggested an html list.
I really don’t have a problem!
Someone posted a question months ago that I think “Everything” search engine would answer. It searches everything on your computer almost instantly! All the freeware sites have it and Bing search will turn it up for you.
Google takes me to MyWay page with a lot of ads but little else???

Roger

Oops!!!
Booboo………. that should have been Ciprian’s list………….. not Codrut’s.
Me bad! Sorry!

Sunny

Hi Jason Darrell
I have a windows folder with music file (mp3), with names of the songs, artists, album names, song duration etc.
I want to create an excel sheet where I can quickly copy/paste all this folder information so that I can sort them out as per my convenience.
Is it possible, please share your thoughts.

Thanks,
Sunny.

Koen Andries

Would it be possible to change the script so that the user can select any specific folder ? Maybe also specify any output folder ? That would be a great help, instead of having to copy the tool in the specific folder first.
Thanks for your concern.

AKM

Can you reupload the FolderTree tool? I’m getting a dead link from OneDrive in both places but I’d love to use it.

LF

I’d really like that too, isn’t there anyone still watching this thread ?

Sally

I’ve been struggling to find a particular folder, which had been moved inadvertently. I looked at several methods to export the folders in the directory, unsuccessfully. Your method and instructions were PERFECT!!! Thank you.

Anonymous

Happy to help. Do not hesitate to subscribe to our newsletter, for more useful guides.

DB

Worked a treat – simple but effective instructions. Thanks for sharing!

William Shaw

The directory tree will help me track pages during Razor Pages development. I plan to map the directory tree to menu items to help ensure that the links between pages are consistent.

Anonymous

Work-related: records/configuration management. Cleaning up identical files stored in multiple directories

John

Nice idea, but when I try to use the tree command, I get

‘tree’ is not recognized as an internal or external command,
operable program or batch file.

But it would have been nice if it worked.

Riza

This definitely what i’ve been looking for all this time
Thanks

Javier

Was for a work-related task, but fails for me (do not work well), just because it is a lot more of 260 characters for directory. Thank you for you work anyway

Bill Laughlin

Thanks for the Folder Tree tool! I would suggest the option of outputting the empty folders too. That is what I really needed.

Jonas

Indeed. Is it possible to have a complete list, including the empty folders?
Now it only shows folders which contains files. So a lot of folders can be lost in the directory structure…

Swadeep

Hi, the tool is great. However, it looks like it is limiting the output. I am seeing only about 30-40 records.

Crenshaw Beildeurbeurghue

Your little utility, FolderTree, would be jolly splendid were it not for the fact that upon clicking the EXE file, Avira security software detects it as a Trojan, automatically grabs it by scruff of its neck and instantly quarantines it.

What say you to that? What kind of Digital Citizenship is that!? Aren’t you ashamed? Why don’t you put on your dunce cap and take an hour facing the corner on a stool.

John Wilkins

Nice article.
You could use a free tool for that:
https://www.mindgems.com/article/export-folder-structure-or-folder-list-to-excel-csv-or-xml-folder-size/

Print, export, largest files and folders…you name it.
Cheers

Hans-Joachim Huber

Hello,

FolderTree.exe works, though too many error messages, say about 10. Latest win10 installed, Excel not yet installed. Finally, resulting CSV-File is OK. Can’t see an *.xlsx File.

“not null, parser” etc.

Do you have some updated version?

Best Regards

Hans-Joachim Huber

Roy Hails

260 character limit so no good for extensive file structures

yomismo

Fantastic exec. It simplifies very much my life. But I´ve found that the length of my paths are too large for that. Is there any way to solve that?
Thanks very much

Ciprian Adrian Rusen

Glad to help. Do not hesitate to subscribe to our newsletter, for more useful tutorials and tools. See here: https://www.digitalcitizen.life/newsletter/

Sandy

Hi there..
I have a windows folder with music file (mp3), with names of the songs, artists, album names, song duration etc.
I want to create an excel sheet where I can quickly copy/paste all this folder information so that I can sort them out as per my convenience.
Is it possible, please share your thoughts.

Thanks,
Sandy..

Barend

This does not work. It only creates a blank CSV vile and then crashes

Jonas

Indeed. Is it possible to have a complete list, including the empty folders?
Now it only shows folders which contains files. So a lot of folders can be lost in the directory structure…