Discussion Locked

FileTree to a text document

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
A user of mine is looking for away in W2K to copy the names of a files to a text document like word of excell so he can edit the names. If we just copy all the files and past them to Word the whole file comes with it. How can we just copy the names of the files to a text document?

9 replies

by bill_w

The easiest way to get the file names to a another file is with the good old > command in dos, using a command something like from a dos shell:

dir *.* >c:\temp\filelist.txt

where you run the command from the directory you want to list. Then open filelist from explorer etc to edit it. That said, why do you want to edit the names? It won't rename the files, of course. If he needs to do that, the problem is a bit more complex (but not insoluble).

Cheers
Bill

by joseph moore

Just to add to the answer from 99100MoreFM:

If you need to append several directory listings to a single TXT file, then use a double greather than sign, ">>".
So, you could set up a BAT file to do several directory listings, spooling to the sameTXT file, like this:

dir c:\winnt >> c:\temp\filelist.txt
dir c:\winnt\system32 >> c:\temp\filelist.txt
dir d:\mp3\*.mp3 >> c:\temp\filelist.txt

Etc.

This discussion is closed to new replies.