This morning, I was ask to my friend to send me an email that containing his directory structure inside his hard drive because he wanted to print his directory structure for his DVD backup. But he did confusing about capture all his directory structure into a single text file.

Then I looked a solutions to help him to capture it. And I already look Windows Explorer and I don't found it. And I remember a MSDOS command to query all directory structure. This tool calls TREE.
OK, if you want to capture it too, open your MSDOS console first (click Start - Run, type cmd then hit Enter). To display your only structure of directory/folder just type tree at your prompt console. Tree command will display all folders and sub folders inside your current folder. So, if you're inside C:\Data folder and your type tree in there, so tree will display all C:\Data sub directories/folders. So if you want to capture your entire folders, make sure, you're in root directory (C:\) or you can also type tree c:\ to do a same action.
Tree command has 2 parameters :
1. /F, Displays the filenames in each directory as well as the directory names. For example : tree /f.
2. /A, Give you a result in ASCII mode. For example : tree /a.
And remember like I has say at above, if you don't include a folder name as its parameter, tree will display directory structure that located inside your current folder but if you want to display folder outside your current folder and you don't want to change folder just type tree c:\data (change c:\data parameter with your own target directory).
OK, we already learn about display our directory structure in screen. Now, back into main article, how to insert the result into a single file ? That's so easy, just add > [namefile_output]. For example, if you want to record c:\data structure into a file, type : tree c:\data /a > data_structure.txt. Why do I use /a parameter ? Because for compatibility issue, better save it in ASCII format.
Hopefully, this article giving some helps for you ....

0 comments