How to List Every File and Folder in a Directory with Tree
To create such a list for yourself, follow these simple instructions:
- Click Start > Run (or press Windows key + R) to open the Run dialog box.
- In the Run dialog box, type ‘cmd’ (without the quotes) and click OK. A black window with a command prompt will appear.
- At the prompt, type the following:
tree "c:\targetdirectory" > "c:\mydirectorytree.txt" /A /F
- Click the Enter key.
- The prompt will move down to the next line, giving the false appearance that nothing happened. You should find your text file in the directory you indicated. Now you can archive the list, or print it out, or do anything you might do to a text file.
Note: Replace ‘targetdirectory’ with the directory from which you want to make your list. Replace ‘mydirectorytree.txt’ with the directory in which you want to save the list, as well as the file name you wish to use for your text file.
This might seem a little foreign if you’ve never or rarely used a DOS prompt. Just practice with a couple of directories and I think you’ll get the hang of it.