Creating a list of files within a directory

Categories: Tips and Tools

There’s been so many times where I needed to get a list of files that reside within a certain directory. There’s software out there to do it (like DDFilecatcher), but who wants to pay for it? It seems like it would be so simple just to create a little script that’ll take the names of all the files I have in a folder and save it to a .txt file. Well, here’s how you do it.

  1. Open notepad
  2. Put this code into the file

    dir /b>filelist.txt

  3. Save it as “filelist.bat”
  4. Place filelist.bat into the directory you need to get the list from
  5. Click on filelist.bat from within the folder
  6. You’ll now have a .txt doc called “filelist.txt”
  7. Simple, right? This has saved me so much time… it’s ridiculous.

    filelist

About the Author

Jason - Father of 3 boys - Open Source Technology advocate and expert. I loves me some Joomla!... Built a profession around open source technology, including Joomla! and Wordpress.

Spread The Love, Share Our Article

Related Posts

There are no related posts on this entry.

Comments

  1. Tully Jul 13, 2009

    You can also just skip the .bat file and dump in the command line…

    dir >files.txt (all files/folders/etc)
    dir /ad >dirs.txt (all directories into file called dirs.txt)
    dir *.doc >doc.txt (all files ending in .doc)
    etc…

    dir (conditions) >filename.ext

  2. Ahmad Alfy Jul 26, 2009

    This is so simple yet so useful!
    Lot’s of times I needed to do it :D Thanks for the tip.

  3. slaFFik Nov 23, 2009

    But it works well with Roman languages only.. For Russian, for example (where 1 letter is 2 bits), it’s not good at all.

Trackbacks

There are no trackbacks on this entry.

Add a Comment

Required

Will not be published. Required

Optional