Sure. Use the command tree /a /f > "d:folderoutput.txt" and change d:folder with where you want to save your output file.
Peter
7 years ago
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
7 years ago
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
6 years ago
I Have too many files in other languages (japanese, spanish, etc..) but in the file are saved with questions marks:
You should try: Directory Report
It can handle files which contain international characters http://www.file-utilities.com
Sav
6 years ago
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
6 years ago
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
6 years ago
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…
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.
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
5 years ago
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
5 years ago
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
5 years ago
Does not work for UNC Paths. Local computer only.
Paul
5 years ago
does this have the 255 char limit on paths and filenames?
nickons
5 years ago
you saved my weeks 🙂 big help.
Question – can we save this into an excel file instead of word or txt file?
Fabi
5 years ago
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
5 years ago
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
5 years ago
Thanks so much for this.
Andrew
5 years ago
This trick saved my butt on a work project. Thank you so much for posting it!
Happy to help. Do not hesitate to subscribe to our newsletter, for more useful content.
Sandra
5 years ago
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
5 years ago
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
4 years ago
Is it possible to do this the otherway around (create the directory structure from the doc)?
EverythingIsDataIsEverything
4 years ago
thanks for putting it together, very helpful
Seth Thomas
4 years ago
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
4 years ago
What I need is to show the only tree of folders and not included the files.
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
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?
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???
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
4 years ago
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
4 years ago
Can you reupload the FolderTree tool? I’m getting a dead link from OneDrive in both places but I’d love to use it.
I’d really like that too, isn’t there anyone still watching this thread ?
Sally
3 years ago
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.
Happy to help. Do not hesitate to subscribe to our newsletter, for more useful guides.
DB
3 years ago
Worked a treat – simple but effective instructions. Thanks for sharing!
William Shaw
3 years ago
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
3 years ago
Work-related: records/configuration management. Cleaning up identical files stored in multiple directories
John
3 years ago
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
3 years ago
This definitely what i’ve been looking for all this time
Thanks
Javier
3 years ago
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
3 years ago
Thanks for the Folder Tree tool! I would suggest the option of outputting the empty folders too. That is what I really needed.
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
3 years ago
Hi, the tool is great. However, it looks like it is limiting the output. I am seeing only about 30-40 records.
Crenshaw Beildeurbeurghue
3 years ago
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.
Print, export, largest files and folders…you name it.
Cheers
Hans-Joachim Huber
3 years ago
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.
Hello. I didn’t have the time to work on this lately. Can you install Excel and let me know if and what errors you get afterward?
Roy Hails
3 years ago
260 character limit so no good for extensive file structures
yomismo
3 years ago
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
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
2 years ago
This does not work. It only creates a blank CSV vile and then crashes
Jonas
2 years ago
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…
Interesting tutorial and outcome. Nice job in showing each step along with a screen grab explaining the steps taken. Learned something….Nice job….WLC
Is there any way to automatically save the output file to a different location than the folder you are trying to map?
Sure. Use the command tree /a /f > "d:folderoutput.txt" and change d:folder with where you want to save your output file.
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.
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!
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.
You should try: Directory Report
It can handle files which contain international characters
http://www.file-utilities.com
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?
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? 😉
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…
Thank you for appreciating our work. Don’t hesitate to subscribe to our newsletter, for the latest tutorials and articles that we publish.
Perfect solution, thank you!
is there any way get tree structure only up to first 4 layers
My aim is to get all this info. into an xlsx file – how do I do this
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.
I want the same!
Thanks for the help!! Any assistance with formatting in Excel? Delimiting,etc…
Nice life hack ! 🙂
great except I just want folder names, the TREE, not the file names.
Thanks though, nice process.
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.
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.
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.
Does not work for UNC Paths. Local computer only.
does this have the 255 char limit on paths and filenames?
you saved my weeks 🙂 big help.
Question – can we save this into an excel file instead of word or txt file?
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
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?
Thanks so much for this.
This trick saved my butt on a work project. Thank you so much for posting it!
Happy to help. Do not hesitate to subscribe to our newsletter, for more useful content.
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?
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.
Is it possible to do this the otherway around (create the directory structure from the doc)?
thanks for putting it together, very helpful
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!
What I need is to show the only tree of folders and not included the files.
Thank you very much!
just omit the /f
ie >tree /a > output.txt
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
Glad to help. Do not hesitate to subscribe to our newsletter, for more useful tutorials like this one.
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?
Try Snap2HTML
https://www.rlvision.com/snap2html/about.php
It’s freeware, and produces really neat HTML listings of folders and files
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???
Oops!!!
Booboo………. that should have been Ciprian’s list………….. not Codrut’s.
Me bad! Sorry!
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.
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.
Can you reupload the FolderTree tool? I’m getting a dead link from OneDrive in both places but I’d love to use it.
I’d really like that too, isn’t there anyone still watching this thread ?
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.
Happy to help. Do not hesitate to subscribe to our newsletter, for more useful guides.
Worked a treat – simple but effective instructions. Thanks for sharing!
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.
Work-related: records/configuration management. Cleaning up identical files stored in multiple directories
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.
This definitely what i’ve been looking for all this time
Thanks
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
Thanks for the Folder Tree tool! I would suggest the option of outputting the empty folders too. That is what I really needed.
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…
Hi, the tool is great. However, it looks like it is limiting the output. I am seeing only about 30-40 records.
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.
It’s a false positive what you’re getting from Avira. The file is made by me, and doesn’t include any viruses. If you want, you can double-check it with virustotal.com. Or, you can see this link: https://www.virustotal.com/gui/file/05f31c695c38e839fbb06bfaf48e46a21fd282775d1755d978ab4579276609fd/detection.
You can also check the code here: https://github.com/codrutneagu/FolderTree
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
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
Hello. I didn’t have the time to work on this lately. Can you install Excel and let me know if and what errors you get afterward?
260 character limit so no good for extensive file structures
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
Glad to help. Do not hesitate to subscribe to our newsletter, for more useful tutorials and tools. See here: https://www.digitalcitizen.life/newsletter/
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..
This does not work. It only creates a blank CSV vile and then crashes
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…