dirk.watkins

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.

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

  1. Dirk Watkins Says:

    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

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

dirk.watkins is powered by WordPress, cookies and tea.
© Dirk Watkins 2008 | Milwaukee, WI
Entries (RSS) and Comments (RSS).
20 queries. 0.347 seconds.