# Solved: How to convert folder, subfolder and file names into text.



## Ripperdan (Oct 28, 2009)

I have a CD with a bunch of folders with a bunch of files and subfolders with a bunch of files on it.

Does anyone know of a free utility to capture those folder and file names into something that I can manipulate (Text, Excel, Word, etc.)? I have found a couple but the ones I found only do 1 layer at a time. I would like to get all the information in a tree structure format.


----------



## Squashman (Apr 4, 2003)

Have you tried Karen's directory printer?
http://www.karenware.com/powertools/ptdirprn.asp

What do you mean by Tree Structure format?

You can in theory get a directory listing from a cmd prompt as well and redirect the output to a text file.

dir E: /s >filelist.txt


----------



## Ripperdan (Oct 28, 2009)

The attached JPG file shows what I mean about tree structure. Something like what you see if you go to "My Documents" and have the "Folders" button on and then click on the + sign so the sub-folders open up.


----------



## TheOutcaste (Aug 8, 2007)

Open Command Prompt
type *Tree E:* (or what ever the correct drive letter\path is)
Right click the Title bar, point to *Edit*, Click *Select All*
Press *Enter*
open Notepad
Press *CTRL+V*


----------



## stantley (May 22, 2005)

TheOutcaste said:


> Open Command Prompt
> type *Tree E:* (or what ever the correct drive letter\path is)
> Right click the Title bar, point to *Edit*, Click *Select All*
> Press *Enter*
> ...


I never saw that before, that's pretty cool. :up:

But it looks like you have to use WordPad, the tree stucture shows up as a bunch of boxes in Notepad.

It also looks like there's a limit on the number of characters that show up. Is there anyway around that?

Edit: I got it to work in Notepad, I was using Tahoma, it works OK with Arial.


----------



## Squashman (Apr 4, 2003)

TheOutcaste said:


> Open Command Prompt
> type *Tree E:* (or what ever the correct drive letter\path is)
> Right click the Title bar, point to *Edit*, Click *Select All*
> Press *Enter*
> ...


I totally forgot about the Tree cmd. I guess only the old timers remember that stuff.


----------



## throoper (Jan 20, 2007)

You'll need the /F switch to also list the files in each subfolder.
Tree Drive: Path /F


----------



## Ripperdan (Oct 28, 2009)

Thank You, Thank You, Thank You. That is exactly what I wanted.

It aslo can be pasted directly into Word and Excel.


----------



## TheOutcaste (Aug 8, 2007)

Squashman said:


> I totally forgot about the Tree cmd. I guess only the old timers remember that stuff.





throoper said:


> You'll need the /F switch to also list the files in each subfolder.
> Tree Drive: Path /F


Seems this "old timer" forgot the /F switch, thanks throoper:up:

There is also a /A switch that uses ASCII instead of extended characters. This let's you redirect output directly to a text file. Not quite as nice looking, but easy to automate.

Tree E:\ /A /F >"%Userprofile%\Desktop\Tree.txt"


----------



## stantley (May 22, 2005)

TheOutcaste said:


> There is also a /A switch that uses ASCII instead of extended characters. This let's you redirect output directly to a text file. Not quite as nice looking, but easy to automate.
> 
> Tree E:\ /A /F >"%Userprofile%\Desktop\Tree.txt"


Thanks, doing it that way you can get all the files on a drive in one text file.


----------



## TheOutcaste (Aug 8, 2007)

stantley said:


> It also looks like there's a limit on the number of characters that show up. Is there anyway around that?


Missed this in my first reading.

The default for the Command Prompt screen buffer is 300 lines. You can increase that to 9999 lines. Which still might not be enough, so redirection is the way to go to be sure you capture all of it.

To change the Screen Buffer size, right click the Title bar of the Command Prompt, click *Properties*.***
Click the *Layout* tab
Enter the desired buffer size in the *Height:* box under *Screen Buffer Size*.
You can make the windows wider here as well, handy with a wide screen display. I have mine at 150.

***If you click on *Default* instead of *Properties*, the settings will apply to all Command Prompt windows you open, unless you've created settings for a particular Command Prompt, either associated with it's name, or the shortcut used to open it.


----------



## stantley (May 22, 2005)

Thanks TheOutcaste, that will indeed come in handy.


----------



## TheOutcaste (Aug 8, 2007)

Just a note, the Tree command doesn't list hidden or system files.


----------

