Command Line Display of a Folder Tree

If you have ever needed to print out a folder hierarchy in Windows this is for you. Go to the command line (Start > Run > cmd), traverse to the folder you want to list out (ie: cd c:/reallysweetfolder/) and type tree.
Your view will look something like this:

├───Browsers
│   ├───Minefield
│   ├───Mozilla Firefox
│   ├───Mozilla Firefox 2 Beta 2
│   └───Other
│       ├───Mozilla Firefox
│       ├───Netscape4
│       └───Opera

Now, of course you’d want to throw in some options (display files in the folders and list it out in ASCII characters) and export this to a text file right? Well, just type:

tree /f /a >c:/myFolderList.txt

Here’s the help for reference:

Graphically displays the folder structure of a drive or path.
TREE [drive:][path] [/F] [/A]

/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.


Posted

in

,

by

Tags:

Comments

One response to “Command Line Display of a Folder Tree”

  1. Dirk Watkins Avatar

    You can also get a quick list of files in a folder and output the results to a text file with this command:

    dir /b > c:\output.csv

Leave a Reply

Your email address will not be published. Required fields are marked *