Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create & print dirlist.txt from dos prompt

Status
Not open for further replies.

ldsmom

MIS
Dec 27, 2001
11
US
I need to create a text file of all directories on D drive and print it. I am at command prompt D:\. I am not familiar with dos prompt commands unfortunately, is there a reference book or a list somewhere? Thanks. (-: if you don't know, ask.
 
I am sorry, you wanted dirlist.txt. So use:

dir >> dirlist.txt

where dir is the command for directory>> means to pipe the output and APPEND
dirlist.txt of course is the file you are exportin to and it will reside in your current directory, or you could put it anywhere you want....


D:\>dir c:\temp >> f:\mydir\dirlist.txt
 
Thanks, Stiddy. That worked. Now how do I get it to list all subdirectories, too? (-: if you don't know, ask.
 
I DID IT!
Kept trying different things and
DIR D:\ /AD /S>>D:\dirlist.txt
got me a text file of all directories and subdirectories.
EUREKA! [bigsmile] if you don't know, ask.
 
If you need a list of command line switches for DIR use 'dir /?' (miss out the quotes of course) this works for most command line tools add /? to the command in question.


Chris.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top