# MS Windows - How do I get a file listing?

**URL:** <https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724>\
**Category:** Factual Questions\
**Created:** [August 15, 2007, 8:33pm UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724 "2007-08-15T20:33:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolf\_meister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolf_meister/32/15202_2.png) [@wolf\_meister](https://boards.straightdope.com/u/wolf_meister)\
**Post date:** [August 15, 2007, 8:33pm UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/1 "2007-08-15T20:33:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [August 15, 2007, 8:38pm UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/2 "2007-08-15T20:38:05Z")

</div>

dir \*.doc \> filenames.txt

---

<div class="post-metadata">

**Author:** ![gossamer](https://avatars.discourse-cdn.com/v4/letter/g/f07891/32.png) [@gossamer](https://boards.straightdope.com/u/gossamer)\
**Post date:** [August 15, 2007, 8:44pm UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/3 "2007-08-15T20:44:35Z")

</div>

[QUOTE=wolf\_meister]  
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.  
[/QUOTE]

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:&gt; cd your-directory-path  
At the command prompt, type dir \*.doc \> wordfiles.txt, i. e.  
c:&gt; 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.

---

<div class="post-metadata">

**Author:** ![wolf\_meister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolf_meister/32/15202_2.png) [@wolf\_meister](https://boards.straightdope.com/u/wolf_meister)\
**Post date:** [August 15, 2007, 9:18pm UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/4 "2007-08-15T21:18:07Z")

</div>

Thanks **Napier** and **gossamer**.  
It Works. 🙂

---

<div class="post-metadata">

**Author:** ![Projammer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/projammer/32/559_2.png) [@Projammer](https://boards.straightdope.com/u/Projammer)\
**Post date:** [August 15, 2007, 9:47pm UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/5 "2007-08-15T21:47:40Z")

</div>

One added note.

dir \*.doc /b \>list.txt

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

---

<div class="post-metadata">

**Author:** ![wolf\_meister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolf_meister/32/15202_2.png) [@wolf\_meister](https://boards.straightdope.com/u/wolf_meister)\
**Post date:** [August 16, 2007, 6:01am UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/6 "2007-08-16T06:01:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Enright3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/enright3/32/2897_2.png) [@Enright3](https://boards.straightdope.com/u/Enright3)\
**Post date:** [August 16, 2007, 1:42pm UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/7 "2007-08-16T13:42:17Z")

</div>

and using the /s switch will traverse through subdirectories.

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

---

<div class="post-metadata">

**Author:** ![chappachula](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@chappachula](https://boards.straightdope.com/u/chappachula)\
**Post date:** [August 16, 2007, 2:42pm UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/8 "2007-08-16T14:42:55Z")

</div>

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… 🙂

---

<div class="post-metadata">

**Author:** ![Enright3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/enright3/32/2897_2.png) [@Enright3](https://boards.straightdope.com/u/Enright3)\
**Post date:** [August 24, 2007, 4:11pm UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/9 "2007-08-24T16:11:05Z")

</div>

[QUOTE=chappachula]  
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… 🙂  
[/QUOTE]

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?

---

<div class="post-metadata">

**Author:** ![Jas09](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jas09](https://boards.straightdope.com/u/Jas09)\
**Post date:** [August 24, 2007, 4:23pm UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/10 "2007-08-24T16:23:02Z")

</div>

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](http://www.theeldergeek.com/file_list_generator.htm)

---

<div class="post-metadata">

**Author:** ![Projammer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/projammer/32/559_2.png) [@Projammer](https://boards.straightdope.com/u/Projammer)\
**Post date:** [August 26, 2007, 7:20am UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/11 "2007-08-26T07:20:08Z")

</div>

[QUOTE=chappachula]  
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… 🙂  
[/QUOTE]

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.

---

<div class="post-metadata">

**Author:** ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)\
**Post date:** [August 26, 2007, 7:56am UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/12 "2007-08-26T07:56:59Z")

</div>

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](http://www.no-nonsense-software.com/freeware/).

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.

---

<div class="post-metadata">

**Author:** ![CannyDan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cannydan/32/548_2.png) [@CannyDan](https://boards.straightdope.com/u/CannyDan)\
**Post date:** [August 26, 2007, 12:05pm UTC](https://boards.straightdope.com/t/ms-windows-how-do-i-get-a-file-listing/415724/13 "2007-08-26T12:05:37Z")

</div>

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.
