How To View and Save a map of your drive’s folders as a Text File.

If you’re looking for a specific folder or simply want to see how your folders and sub-folders are structured so you can reorganize them, you can view them all in a flowchart using the ‘tree’ command.

View a map of your drive’s folders.

Typing tree on its own will display the sub-folder structure of whichever folder you happen to open Command Prompt in. But you can view specific folders by adding a folder path: tree C:\Users\Public, for example.


You can even view the entire folder structure of your hard drive by entering tree C:\, though this will produce a large flowchart that will probably exceed the default number of lines available in the Command Prompt console. 

You can extend the number of viewable lines, but it’s easier to save the flowchart as a text file that you can refer to any time. For this, you have to know how to save the command’s output as a text file.

Save a command’s output as a text file.

Any information you generate in a Command Prompt window will disappear as soon as you close it. If you want a more permanent record of something you’ve generated in Command Prompt, such as a flowchart of your folder structure, you can output the results to a text file. This is handy if you need to refer to the information later, or if you need to email it to someone who’s helping you with a PC problem. 

To do this, you need to add an ‘operator’ to the end of your command- in this case, the operator is >, followed by the file’s save location and file name. For instance, typing tree C:\Users\Username\Documents\tree.txt will generate a folder structure of your entire hard drive and save this as a file called ‘tree.txt’ that will be stored in your C:\Users\Username\Documents folder.

In most cases, this will look fine in a text file. But in the case of folder maps, you should use the /a switch, which generates ASCII characters, otherwise, the output will be barely comprehensible in a text file, the final command line would be tree C:\ /a > C:\Users\Username\Documents\tree.txt.

If you like this post and find it useful then you can show your support by donating a small amount from your heart. You can also show your support by following us on Facebook and Twitter. 

Post a Comment

Previous Post Next Post