PDA

View Full Version : Output the contents of a folder to a text file


Wodrick
28th Jul 2007, 11:01
Collegue has a requirement to form an index of the contents of a folder. He has a large folder full of .pdf documents, all of which have "fully descriptive" hence long file names.

I did a search and came up with something from 2000 using the dos prompt, and listing the directory then using the &gt command to generate filename.txt. can't get this to work comes up as unknown command.

Am I missing something or is this a feature of the psuedo dos implementation in XP.

If this is so, how can I produce a listing of the contents of a folder that will subsequently be editable in word or notepad etc?

BOFH
28th Jul 2007, 11:27
I hope that I have interpreted your problem correctly. Please try:
dir /b >> foo.txt

BOFH

Wodrick
28th Jul 2007, 11:48
Ah thank you works perfectly just what was required

IO540
28th Jul 2007, 21:02
One uses a single chevron i.e.

dir /b > name.txt

BOFH
29th Jul 2007, 17:53
IO540

you are quite right. >> appends.

BOFH