MS Windows - How do I get a file listing?

By that I mean, if I have 50 Word documents and I wanted a list of the file information (particularly names) for each, how do I that without the “brute force” method of actually typing each name into another file? I don’t want just a printout.
I’d like it to be in a text file which then could be manipulated in a program such as Excel, Word, etc.

dir *.doc > filenames.txt

This may not be the best solution, but it will work.
First, fire up the command interpreter: START button, run, then type in CMD or COMMAND.
When the window shows up, navigate to your word file directory:
c:> cd your-directory-path
At the command prompt, type dir *.doc > wordfiles.txt, i. e.
c:> dir *.doc > wordfiles.txt
Press return.
A directory listing will be in wordfiles.txt. This is a text file you can manipulate with notepad, or the DOS editor.

Thanks Napier and gossamer.
It Works. :slight_smile:

One added note.

dir *.doc /b >list.txt

will give you a list of names only. No sizes, dates, or other misc data

Projammer
and thank you for your contribution. (I’m glad I came back to this thread).

and using the /s switch will traverse through subdirectories.

check out dir /? to get all of the options.

while we are on the subject, can anyone explain why the only way to do this is with a 20 year old DOS command?

I knew about the dir command. But I opened this thread hoping to learn if there is a Window-based way to do this. It seems like a pretty basic function that most people need, but there is no intuitive way to do it.

I’m the only old fogey in my office who knows how to use DOS. A whole generation has grown up using mouse clicks, and they get freaked out if you tell them to type words to make the computer do something… :slight_smile:

I’m not sure what to say to your question except to say that Windows is a graphical program… I would guess their take is that you don’t need to know about the directory structure. Actually, I would think that while it’s a pretty basic function, that most people DON’T need.

I haven’t used linux/unix in while. Is there way to do it there w/o going to the OS with an ls command?

As an addition - here is a neat outline for adding this option to your Explorer right-click context menu. You create a batch file using the commands provided in this thread and then add it as an action on the right-click menu. Could be useful if you do this sort of thing all the time and want to be able to do it from Windows Explorer.

http://www.theeldergeek.com/file_list_generator.htm

I once put together a small VB script to do it. I can dig it up or recreate it if you need it. Combine it with the technique for adding it to the right-click menu and you’d have a winner.

There’s a small, free utility called PrintFolder that will do the job without all the messing around with the command line. I’ve been using it for about a year now, and it’s great.

If you have a folder full of files, and you want a list of the files, you just right-click on the folder, and select “Print Folder” from the context menu. You get a notepad-type text file listing files, as well as (if you want) the file size, date, and time.

You can download PrintFolder 1.3 here.

You’ll see that there’s also PrintFolder Pro available, for people who want much greater functionality. It’s 30 bucks. I have no need for it, but folk who need to do this sort of thing a lot might find it useful.

Nothing useful to contribute, just an observation.

**Chappachula ** wonders how many of us old fogeys remember DOS. But how many of us noticed that **gossamer’s ** instructions include “Press return”?

How long has it been since we’ve seen a Return key on a keyboard?

Great info here though; I’ll use it.