# In Windows, getting the list of files found as text?

**URL:** <https://boards.straightdope.com/t/in-windows-getting-the-list-of-files-found-as-text/243980>\
**Category:** Factual Questions\
**Created:** [May 7, 2004, 11:27am UTC](https://boards.straightdope.com/t/in-windows-getting-the-list-of-files-found-as-text/243980 "2004-05-07T11:27:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoCoolUserName](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@NoCoolUserName](https://boards.straightdope.com/u/NoCoolUserName)\
**Post date:** [May 7, 2004, 11:27am UTC](https://boards.straightdope.com/t/in-windows-getting-the-list-of-files-found-as-text/243980/1 "2004-05-07T11:27:44Z")

</div>

Win2K, to be exact. When I do a search for a particular type of file, say \*.html, I get a list of all the files that match my search. I want to use this list of files as text:

file1.html  
file2.html  
…

How can I do that?

---

<div class="post-metadata">

**Author:** ![Tabby\_Cat](https://avatars.discourse-cdn.com/v4/letter/t/6a8cbe/32.png) [@Tabby\_Cat](https://boards.straightdope.com/u/Tabby_Cat)\
**Post date:** [May 7, 2004, 11:47am UTC](https://boards.straightdope.com/t/in-windows-getting-the-list-of-files-found-as-text/243980/2 "2004-05-07T11:47:26Z")

</div>

> [@NoCoolUserName](#):
>
> Win2K, to be exact. When I do a search for a particular type of file, say \*.html, I get a list of all the files that match my search. I want to use this list of files as text:
> 
> file1.html  
> file2.html  
> …
> 
> How can I do that?

Well, you could possibly do this in the command prompt (not too sure if you HAVE a command prompt, but you can try it anyway)

dir \*.html \>\> list.txt

which will output the contents of the dir into the text file. Of course, you will have to do some editing after that, but I can’t think of any other method off hand that doesn’t require programming. 😛

---

<div class="post-metadata">

**Author:** ![Small\_Clanger](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Small\_Clanger](https://boards.straightdope.com/u/Small_Clanger)\
**Post date:** [May 7, 2004, 11:47am UTC](https://boards.straightdope.com/t/in-windows-getting-the-list-of-files-found-as-text/243980/3 "2004-05-07T11:47:36Z")

</div>

You’re gonna need a console-window/DOS-prompt

The command is:

\*_DIR .html_

And redirect the output to a file:

\*_DIR .html \> FileList.txt_

And open the .txt file in the editor of your choice. If you type **DIR /?** it’ll tell you what the listing options are.

---

<div class="post-metadata">

**Author:** ![Jdeforrest](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@Jdeforrest](https://boards.straightdope.com/u/Jdeforrest)\
**Post date:** [May 7, 2004, 12:23pm UTC](https://boards.straightdope.com/t/in-windows-getting-the-list-of-files-found-as-text/243980/4 "2004-05-07T12:23:33Z")

</div>

If you want to search the whole computer for files:

If your not already in the c: drive you’ll need to type “ **c:** ” to change to that drive

Go to the root directory of the c: drive by typing, “\*\*cd\*\*”

Then type “\*_dir .html /s \> list.txt_”

The **/s** searches all subdirectories.

---

<div class="post-metadata">

**Author:** ![HugoRed](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@HugoRed](https://boards.straightdope.com/u/HugoRed)\
**Post date:** [May 7, 2004, 1:01pm UTC](https://boards.straightdope.com/t/in-windows-getting-the-list-of-files-found-as-text/243980/5 "2004-05-07T13:01:59Z")

</div>

I have 2 freeware programs that do this.  
They are “Dirlist” and 'JDirPrinter" try googling either because I don’t remember where I got them.  
With a little practice you can modify their output to different directories.  
Dirlist must be in the directory you want to print.

---

<div class="post-metadata">

**Author:** ![Dog80](https://avatars.discourse-cdn.com/v4/letter/d/6bbea6/32.png) [@Dog80](https://boards.straightdope.com/u/Dog80)\
**Post date:** [May 7, 2004, 1:14pm UTC](https://boards.straightdope.com/t/in-windows-getting-the-list-of-files-found-as-text/243980/6 "2004-05-07T13:14:35Z")

</div>

for a verbose output you should also use the /b switch  
i.e.

\*_dir .html /b /s \> files.txt_

---

<div class="post-metadata">

**Author:** ![GorillaMan](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@GorillaMan](https://boards.straightdope.com/u/GorillaMan)\
**Post date:** [May 7, 2004, 1:30pm UTC](https://boards.straightdope.com/t/in-windows-getting-the-list-of-files-found-as-text/243980/7 "2004-05-07T13:30:03Z")

</div>

[Agent Ransack](http://www.mythicsoft.com/agentransack/default.aspx) does what you need - and is a far superior search tool anyway.

---

<div class="post-metadata">

**Author:** ![HugoRed](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@HugoRed](https://boards.straightdope.com/u/HugoRed)\
**Post date:** [May 7, 2004, 1:57pm UTC](https://boards.straightdope.com/t/in-windows-getting-the-list-of-files-found-as-text/243980/8 "2004-05-07T13:57:09Z")

</div>

try here  
[http://www.spadixbd.com/freetools/](http://www.spadixbd.com/freetools/)
