Is there any good tool that I can use to get a browsable tree-view of the directory structure of a partition? Something like the tree view in the windows explorer. Additionally, I need to be able to export that file-list, so that others can view it without access to the partition.

Edit To clairify, I am not interested in the files themselves. I just need a hierarchical listing of all files. Zipping them all up is not what I want.

link|improve this question

80% accept rate
If you want, I can write an AutoIt script to export the directory listing into plain-text in whatever style you would like. You could then write a program to parse it back into a directory-view like style. – Breakthrough Aug 4 '11 at 13:38
feedback

5 Answers

up vote 3 down vote accepted

Assuming your directory tree is of reasonable size, you could also use the built in tree command, which produces a rather pretty looking directory tree. Unfortunately this prettiness is difficult to get working outside of a cmd instance, so you'll probably want to tell it to just use ascii characters with the /A switch.

Example:

From a small multi-level structure

+---A
|   +---A
|   \---B
+---B
|   \---A
|       \---A
\---C

You can then redirect this to a file using a command like:

tree /A ["directory path"] > tree.txt

Where the directory path is optional, but useful if you want to tree something which isn't the current working directory.

link|improve this answer
1  
You can also pipe this output to a text file by doing: tree E: \A \F > output.txt – xan Aug 4 '11 at 13:35
@xan; Whoops, that was the important bit of the answer and I completely forgot about it! Thanks – Phoshi Aug 4 '11 at 13:37
@xan just FYI, you need to use forward-slashes (/) instead of backslashes for command line argument identifiers. Backslashes are directory tree separators in Windows systems. – Breakthrough Aug 4 '11 at 13:39
@Breakthrough: Whoops - yes, tree E: /A /F > output.txt - mistyped my slashes! – xan Aug 4 '11 at 15:32
feedback

If raw text as the output is fine, then you can run the following from a command prompt:

DIR C:\ /S > output.txt

Where output.txt will be generated in the current working directory, and contain a listing of all files and directories on the C: drive. If you want just a full output of files with their paths, run the following:

DIR C:\ /B /S > output.txt

It would also be a trivial task to write a program to parse the output back into a directory view style program for you to view.

link|improve this answer
feedback

You could just use xcopy with the /T and /E option to copy only directories. That would get you a complete and browsable copy of the structure, and answers the first part of your question. Does not let you view files though...

link|improve this answer
feedback

You could use an archiving tool, such as WinZIP that can zip an entire directory structure into a single file, that you can, for example, transfer on a network, or put on a USB disk. Some tools will also keep flags such as read-only, archive, etc.

Under Linux, my favorite tool for such action is tar, that will take an entire directory structure into a single file, which I can couple with gzip to actually compress the whole thing.

link|improve this answer
feedback

This may help: How To Print A Directory Tree From Windows Explorer

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.