Extract list of sub-folders in a folder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to be able to get a list of all the folders contained in another
folder into another program, say Excel. I found an Excel macro that will
list all the files in a given folder, but it does not list the folders in
that folder. Alternatively, a print-out of the folders would be better than
nothing, although I'm looking for something better than screen shots, for
which I'll need numerous shots to print everything (ex. 200 folders).
 
I'd like to be able to get a list of all the folders contained in another
folder into another program, say Excel. I found an Excel macro that will
list all the files in a given folder, but it does not list the folders in
that folder. Alternatively, a print-out of the folders would be better
than
nothing, although I'm looking for something better than screen shots, for
which I'll need numerous shots to print everything (ex. 200 folders).


I used to have a program that would print "complete" directory contents in
a simple, straightforward way. It was called "Karen's directory printer"
or something very close to that. Try "SoftPedia.com" and do a search for
"Karen's". Should find it, if it's there.

Hope this helps,


Fred
 
Fred - thank you! I found Karen's Directory Printer, downloaded and
installed it. There are many options and I haven't explored them all yet,
but I'm sure it will do what I need, and then some. Thank you very much!
 
If you want the listing in text so you can loadandmanipulate it in excel
try;

dir /ad /s /b > c:\dir.txt

Regards
Mark Dormer
 
Hi, Ken.

There is a KB article explaining how to create a Print Directory command for
Windows XP. It doesn't work in Vista as outlined there because the File
Folder | File Types screen does not exist in Vista. But all is not lost. A
quick Google search finds at least a couple of ways to use the simple batch
file created for WinXP to create a new SendTo option in Vista to do the same
thing. (Google got nearly 1,000 hits for "printdir +vista", but this first
one worked, so I didn't try the others.)

First, see the KB article:
How to add the Print Directory feature for folders in Windows XP
http://support.microsoft.com/?kbid=321379

Then read this page to see how to adapt it for Vista:
Another little Vista annoyance: Printing directory contents
http://bxmedia.net/blog/wpmu/vftc/2...-vista-annoyance-printing-directory-contents/

I just tried it and it worked. ;<) But I chose to put the little
PrintDir.bat file into a "neutral" location where I can use it from either
WinXP or Vista; in my case, that is E:\regs\PrintDir.bat. Then I can browse
to it when I'm ready to add it to my SendTo menu, as explained in the blog.

RC
--
R. C. White, CPA
San Marcos, TX
(e-mail address removed)
Microsoft Windows MVP
(Running Windows Live Mail beta in Vista Ultimate x64)
 
Hi, again, Ken.

Aw, what the heck! Rather than read those other references, just do this:

1. Using Notepad (or any other plain text editor), create a short file
containing just this (just copy'n'paste):

@echo off
dir %1 /-p /o:gn > "%temp%\Listing"
start /w notepad /p "%temp%\Listing"
del "%temp%\Listing"
exit

2. Save that text file wherever you like where it will be easily
accessible, but out of your way. (My file is E:\regs\PrintDir.bat.)

3. Open the SendTo menu by pressing <Win>+R and typing (without the
quotes): shell:sendto

4. In the SendTo folder that pops up in an Explorer window, right-click in
a blank space on the right side and click New | Shortcut.

5. Browse to your PrintDir.bat file - or just type the full pathname into
the box - then click Next.

6. Either accept the default name (PrintDir.bat - the name of the file), or
type a better one (I called it "Print Directory"), then click Finish.

7. To use your new command to type a directory listing, just browse to the
folder you want to list, right-click on it, and click SendTo | Print
Directory. (Note that this will also print only the current folder, not the
entire tree. To get the full directory tree, just add "/s" (no quotes)
before the ">" in the first line of the text file. I've saved a second
version of PrintDir.bat, called PrintDirS.bat, and created a second SendTo
shortcut that calls that file.)

8. Get your printed listing from your printer. ;<)


All that is basically what KB 321379 and the "Views from the Coop" blog
said. Please report back with your experience if you use this so that we
all can benefit.

RC
--
R. C. White, CPA
San Marcos, TX
(e-mail address removed)
Microsoft Windows MVP
(Running Windows Live Mail beta in Vista Ultimate x64)
 
Back
Top