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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

output a directory listing to a text file with true path

Status
Not open for further replies.

drew1701d

Technical User
May 15, 2002
295
0
0
US
I need to do a directory listing and have that listing exported to a TXT file with the true path, i.e. if directories product1 product2 export1 export3 are on my G: drive in a main folder call August i want to output that listing in the format below.

G:\August\product1
G:\August\product2
G:\August\export1
G:\August\export3

anyone provide a command i'm overlooking or free tool or script that would do this for me on a Windows XP system?

thanks in advance



"I'm certifiable, not certified. It just means my answers are from experience...not a book
 
from the command prompt type

dir > filename.txt

PRESS ENTER

filename.txt will be written to the folder you were in.


you can change it to

dir > c:\folder\filename.txt

from the command prompt type

DIR /?

for a list of formatting options

-- Jason
"It's Just Ones and Zeros
 
Other useful switches:
/s will include subfolders
/ad will show folders only, not files.
/b will show in "bare" format

DIR /s/b/ad >filename.txt
 
Hi drew1701d

To get a listing of just the directories:

dir g: /a:d /s /b >dirlist.txt

However, to get a list of the files in the directories with the full path on the same line, use:

attrib g:*.* /s >filelist.txt

Jock
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top