# Windows file lists

**URL:** <https://boards.straightdope.com/t/windows-file-lists/48420>\
**Category:** Factual Questions\
**Created:** [January 4, 2001, 5:41pm UTC](https://boards.straightdope.com/t/windows-file-lists/48420 "2001-01-04T17:41:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cegan523](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@cegan523](https://boards.straightdope.com/u/cegan523)\
**Post date:** [January 4, 2001, 5:41pm UTC](https://boards.straightdope.com/t/windows-file-lists/48420/1 "2001-01-04T17:41:50Z")

</div>

Is there a way to copy the contents of a directory - just the file names - in windows. For instance, I’m creating a word document, and I want to list the contents of a directory in it.

I suppose I could open a DOS window, DIR, and cut and past… but is there a more direct way?

Unix is so much easier… ls | mylistofstuff

---

<div class="post-metadata">

**Author:** ![troub](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/troub/32/14802_2.png) [@troub](https://boards.straightdope.com/u/troub)\
**Post date:** [January 4, 2001, 5:54pm UTC](https://boards.straightdope.com/t/windows-file-lists/48420/2 "2001-01-04T17:54:23Z")

</div>

There is also a pipe command in DOS. You could try  
**dir \> mylist.txt**

---

<div class="post-metadata">

**Author:** ![carnivorousplant](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/carnivorousplant/32/3563_2.png) [@carnivorousplant](https://boards.straightdope.com/u/carnivorousplant)\
**Post date:** [January 4, 2001, 5:55pm UTC](https://boards.straightdope.com/t/windows-file-lists/48420/3 "2001-01-04T17:55:57Z")

</div>

Go to DOS.  
CD\ directory you want; for instance for a directory of mydocuments:  
cd\mydocuments

At the prompt type:

DIR \> DIR.TXT

The listing will be in a text file DIR.TXT

---

<div class="post-metadata">

**Author:** ![SmackFu](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@SmackFu](https://boards.straightdope.com/u/SmackFu)\
**Post date:** [January 4, 2001, 6:00pm UTC](https://boards.straightdope.com/t/windows-file-lists/48420/4 "2001-01-04T18:00:10Z")

</div>

Here’s a utility that does the job:  
[http://www.zdnet.com/pcmag/pctech/content/16/05/ut1605.001.html](http://www.zdnet.com/pcmag/pctech/content/16/05/ut1605.001.html)

Only useful, I guess, if you’re going to be doing this a lot.

---

<div class="post-metadata">

**Author:** ![cegan523](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@cegan523](https://boards.straightdope.com/u/cegan523)\
**Post date:** [January 4, 2001, 6:03pm UTC](https://boards.straightdope.com/t/windows-file-lists/48420/5 "2001-01-04T18:03:26Z")

</div>

Smakfu - you da man (or maybe woman)

exactly what I was looking for, thanks.

also, thanks for the other posts… I didn’t realize that there was a pipe command in dos. that’s bound to prove useful in itself.

thanks, all
