Printing, or saving to Excel, directory tree

  • Thread starter Thread starter Steve Mc
  • Start date Start date
S

Steve Mc

How can that be done ? Want folders and sub-folders only, not the individual
files.

Thanks,

--



Steve Mc

DNA to SBC to respond
 
At a command prompt:

C:\>dir /s /b /a:d >c:\dirlist.txt

look for the c:\dirlist.txt file after the command is done.

John
 
Make that:

dir /s /b /a:d >c:\dirlist.txt

the C:\> prompt was inadvertently copied from the command console.

John
 
Thank you.
Been I long time since I DOS'ed anything.

I asked for all sub folders and no individual files, but didn't realize that
was still going to be overkill.
Is there a command that would maybe print just one subfolder from the
directory I'm changed to ?

Such as:
My Documents\My Music
My Documents\My Pictures
etc.

Also, is the a:d requesting also those drives also ? It only printed the C
stuff, but a and d were not being used at the time ?

Thanks again

--



Steve Mc

DNA to SBC to respond
 
You might start by quoting some of the text you are responding to so
the thread can flow.

Then you could issue
dir /?
to find out what options are supported and what they mean.

And if you decide that dir is not sufficiently flexible for your
needs, you could always google for directory+print to get some 230
million references, at least one of which is bound to provide a
solution you like.
 
Steve said:
How can that be done ? Want folders and sub-folders only, not the individual
files.

Thanks,


From the command prompt (Start > Run > Cmd.exe), simply change to
the desired directory and type "dir > filelist.txt" or "dir > lpt1,"
just as you used to do in DOS. Any of the switches for the DIR command
(type "dir /?") will work with this command, if you wish to modify the
output. You can then subsequently edit the resulting text file using
NotePad, WordPad, Word, etc.

Alternatively:

HOW TO Add a Print Directory Feature for Folders in Windows XP
http://support.microsoft.com/?kbid=321379



--

Bruce Chambers

Help us help you:


http://support.microsoft.com/default.aspx/kb/555375

They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. ~Benjamin Franklin

Many people would rather die than think; in fact, most do. ~Bertrand Russell

The philosopher has never killed any priests, whereas the priest has
killed a great many philosophers.
~ Denis Diderot
 
Bruce Chambers said:
From the command prompt (Start > Run > Cmd.exe), simply change to the
desired directory and type "dir > filelist.txt" or "dir > lpt1," just as
you used to do in DOS. Any of the switches for the DIR command (type "dir
/?") will work with this command, if you wish to modify the output. You
can then subsequently edit the resulting text file using NotePad, WordPad,
Word, etc.

Alternatively:

HOW TO Add a Print Directory Feature for Folders in Windows XP
http://support.microsoft.com/?kbid=321379


Thanks. I did see that and may give it a try, though I'm a bit reticent
about modifying the registry.

--



Steve Mc

DNA to SBC to respond
 
Steve said:
Thank you.
Been I long time since I DOS'ed anything.

I asked for all sub folders and no individual files, but didn't realize that
was still going to be overkill.
Is there a command that would maybe print just one subfolder from the
directory I'm changed to ?

Such as:
My Documents\My Music
My Documents\My Pictures
etc.

Omit the /s switch and you will get the folder list from the current
directory only:

dir /b /a:d >c:\dirlist.txt

Also, is the a:d requesting also those drives also ? It only printed the C
stuff, but a and d were not being used at the time ?

No, /a is the attribute switch, it tells DIR to only return objects or
files with certain attributes, and "d" is the "Directory" attribute, it
instructs DIR to only return directory listings. As another poster
noted, you can get help on the command by using the /? switch:

dir /?

John
 
Omit the /s switch and you will get the folder list from the current
directory only:

dir /b /a:d >c:\dirlist.txt

Thank you , that's what I was looking for.

One last DOS question, if you don't mind.

I'm trying to change directories ,via the CD command, to my external hard
drives, but it doesn't seem to be working.

such as from main command prompt C:\Documents and Settings\Steve>
cd:\my documents goes to that directory , but my externals G:\ and
N:\ I can't get cd to recognize.
In Explorer, they are showing as:

My Book Essential (G) and
My Book (N)

Thanks again,




Steve Mc

DNA to SBC to respond

--
 
One last DOS question, if you don't mind.

I'm trying to change directories ,via the CD command, to my external hard
drives, but it doesn't seem to be working.

such as from main command prompt C:\Documents and Settings\Steve>
cd:\my documents goes to that directory , but my externals G:\ and
N:\ I can't get cd to recognize.


You don't switch drives with CD

Simply type g: or n:

That will take you to the drive. Then you can use CD to switch to
whatever folder you want in the drive.
 
Ken Blake said:
You don't switch drives with CD

Simply type g: or n:

That will take you to the drive. Then you can use CD to switch to
whatever folder you want in the drive.

Perfect. Thank you so much.

Steve

--



Steve Mc

DNA to SBC to respond
 
Back
Top