# Quick Computer Question

**URL:** <https://boards.straightdope.com/t/quick-computer-question/228981>\
**Category:** Factual Questions\
**Created:** [February 13, 2004, 3:16am UTC](https://boards.straightdope.com/t/quick-computer-question/228981 "2004-02-13T03:16:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![theclam](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@theclam](https://boards.straightdope.com/u/theclam)\
**Post date:** [February 13, 2004, 3:16am UTC](https://boards.straightdope.com/t/quick-computer-question/228981/1 "2004-02-13T03:16:25Z")

</div>

Say I have a folder with 100+ files in it.

By the way, this is in Windows 2000.

Is it possible to copy all the file names into a text file without having to do it manually?

E.G. I want a text file that looks like this:

file001.jpg  
file002.avi  
file003.mov  
file004.txt  
…  
file122.jpg  
file123.doc

Thanks.

---

<div class="post-metadata">

**Author:** ![Number](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/number/32/242_2.png) [@Number](https://boards.straightdope.com/u/Number)\
**Post date:** [February 13, 2004, 3:22am UTC](https://boards.straightdope.com/t/quick-computer-question/228981/2 "2004-02-13T03:22:30Z")

</div>

Yes. Go to the command line, cd to the directory, and type **dir \>list.txt**. This will dump the output of the dir command to a text file. Type **dir /?** to see all the switches you can use.

---

<div class="post-metadata">

**Author:** ![Lobsang](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lobsang/32/4067_2.png) [@Lobsang](https://boards.straightdope.com/u/Lobsang)\
**Post date:** [February 13, 2004, 3:24am UTC](https://boards.straightdope.com/t/quick-computer-question/228981/3 "2004-02-13T03:24:06Z")

</div>

start-\>run (press enter)  
cmd (enter)

go to the directory where the files are stored (cd pictures)

dir \>\> files.txt

files.txt will list the files (with some more stuff included)

---

<div class="post-metadata">

**Author:** ![Lobsang](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lobsang/32/4067_2.png) [@Lobsang](https://boards.straightdope.com/u/Lobsang)\
**Post date:** [February 13, 2004, 3:25am UTC](https://boards.straightdope.com/t/quick-computer-question/228981/4 "2004-02-13T03:25:16Z")

</div>

arse. beaten to the post. :mad:

---

<div class="post-metadata">

**Author:** ![K364](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/k364/32/5_2.png) [@K364](https://boards.straightdope.com/u/K364)\
**Post date:** [February 13, 2004, 6:07am UTC](https://boards.straightdope.com/t/quick-computer-question/228981/5 "2004-02-13T06:07:19Z")

</div>

To get the filename and extension only, use:

DIR /B \> files.txt

BTW, the \>\> will append to the end of an existing file, where the \> will always start fresh, ie overwrite the existing file.

---

<div class="post-metadata">

**Author:** ![Dragwyr](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dragwyr/32/2855_2.png) [@Dragwyr](https://boards.straightdope.com/u/Dragwyr)\
**Post date:** [February 13, 2004, 3:05pm UTC](https://boards.straightdope.com/t/quick-computer-question/228981/6 "2004-02-13T15:05:59Z")

</div>

You can also download a program called rjhExtensions. It will give you the ability to print your current directory straight from Windows Explorer. It also will give you some other enhancements such as a File Renamer, take you straight to a DOS prompt in the dir you are at in Win Explorer, and it also has a secure file shredder.

I use this utility daily and it makes things so much easier for me.

---

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [February 13, 2004, 8:49pm UTC](https://boards.straightdope.com/t/quick-computer-question/228981/7 "2004-02-13T20:49:44Z")

</div>

In case anyone wants to know how to do it on a Mac, BBEdit or BBEdit Lite will do it nicely. Edit menu --\> Insert --\> Folder Listing.

---

<div class="post-metadata">

**Author:** ![Troy\_McClure\_SF](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/troy_mcclure_sf/32/4150_2.png) [@Troy\_McClure\_SF](https://boards.straightdope.com/u/Troy_McClure_SF)\
**Post date:** [February 13, 2004, 11:23pm UTC](https://boards.straightdope.com/t/quick-computer-question/228981/8 "2004-02-13T23:23:14Z")

</div>

> [@AHunter3](#):
>
> In case anyone wants to know how to do it on a Mac, BBEdit or BBEdit Lite will do it nicely. Edit menu → Insert → Folder Listing.

Sweet! I was gonna ask that, since C&P messes up the order.

---

<div class="post-metadata">

**Author:** ![rjung](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rjung](https://boards.straightdope.com/u/rjung)\
**Post date:** [February 14, 2004, 12:04am UTC](https://boards.straightdope.com/t/quick-computer-question/228981/9 "2004-02-14T00:04:12Z")

</div>

Or open up a Terminal, then type

**$** ls /the/path/where/my/folder/is \> ~/listing.txt

That will put “listing.txt” in your home directory, with the names of all the files in the folder. Nothing against BBEdit, which roxxors, but a free solution never hurts. 😉

---

<div class="post-metadata">

**Author:** ![Paco](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Paco](https://boards.straightdope.com/u/Paco)\
**Post date:** [February 14, 2004, 3:26am UTC](https://boards.straightdope.com/t/quick-computer-question/228981/10 "2004-02-14T03:26:19Z")

</div>

I saw this and got excited because I thought I could give a link to a java program I had to write a week ago that did this. Oh well, the command line thing sounds a lot easier.
