How to Create a List of Files and Folders in a Directory

We have several files and folders in our computers. Sometimes we may require a list of files and folders in a particular directory. Looking for each file and folder and listing them isn’t easy. But there’s an easy way to generate or create a list of files and folders in a location. Here’s how you do it:

Go to Start> Accessories> Notepad

Now type the following:

dir /s > output.txt

Save the file as “genfile.bat”, close Notepad.

Now to generate a files and folder list of a specific location, simply paste genfile.bat into it and double click on it. It will create a new text file in same place with the name “output” which will contain the list of all the files and folders present in the location. It not only shows the names of files and folders but it also shows the date on which they were created, their file size, etc.

STAY IN TOUCH WITH UPDATES | SUBSCRIBE VIA RSS or Email |

Discussion

24 comments for “How to Create a List of Files and Folders in a Directory”

  1. MyAvatars 0.2

    Neat!

    Posted by Luke | July 9, 2008, 11:36 am
  2. MyAvatars 0.2

    I’ve been trying to figure out a way to do this for so long I was beginning to think it would be quicker to just type up a list myself. Thanks for saving me so much time!

    Posted by Jeff | August 3, 2008, 8:16 pm
  3. MyAvatars 0.2

    Best.Tip.Ever.

    Posted by Katja | October 13, 2008, 7:13 pm
  4. MyAvatars 0.2

    awesome.

    Posted by rojojaal | November 11, 2008, 5:06 pm
  5. MyAvatars 0.2

    Really great! Just what I needed. I modified it slightly to list only files with a certain extension. Thought I’d share.

    Like so:

    dir /s *.html > html_list.txt

    Posted by Matthew | December 10, 2008, 5:43 pm
  6. MyAvatars 0.2

    Wow it’s nice tip
    Thank

    Posted by financial | January 8, 2009, 9:05 am
  7. MyAvatars 0.2

    Whoa!! Great tip!! I was searching around for a program or something which can do this! Nice!

    Is there a way to only list folder names only? I’d like to list the programs I’ve installed on my computer before I re-format.

    Thanks again!

    Posted by Joe | March 7, 2009, 2:51 am
  8. MyAvatars 0.2

    “save as *.csv”
    to save the generated text file as a comma seperated value file (*.csv) for use in excel and word simply open with text editor (notepad, wordpad, etc.) and “Save as”, and select “all file types”, (use ANSI format if option is shown), and rename as a *.csv file. Open a spreadsheet program (MS Excel, Open Office, etc.) select “Data” and “Import External Data”, then select this csv file. As part of the process you can decide which lines to import and which to skip. Males larger files much easier to sort and saves a lot of cutting and pasting.

    Posted by perry | March 16, 2009, 4:07 pm
  9. MyAvatars 0.2

    This is still little complicated to copy genfile.bat, open output.txt and delete it at end.

    Try wList for creating file lists:
    http://www.sharktime.com/us_wList.html

    For me, it is the best solution ever.
    T.

    Posted by Tankserbua | April 18, 2009, 12:17 pm
  10. MyAvatars 0.2

    i really like the information provided but if you are looking at just a list of folders names that are in a directory you can creat the bat file with this
    dir /a:d /b > folderList.csv
    a=archivable files
    :d directories only
    b=bare names only

    Posted by Franklin | April 30, 2009, 3:38 pm
  11. MyAvatars 0.2

    hari om.
    thanks for the help.I have some thousand of books in directories containing tif image of each page.When I wanted to download newer ones i want not to download copies. So I needed a list.
    dhanyawAd.

    Posted by mahastat | May 14, 2009, 9:23 pm
  12. MyAvatars 0.2

    great tip saved me alot of typing. thanks

    Posted by akronik | June 6, 2009, 1:09 pm
  13. MyAvatars 0.2

    thanks for the help guys, is there a way of listing just the folders and subfolders?
    cheers!

    Posted by matt | July 14, 2009, 8:57 pm
  14. MyAvatars 0.2

    Thanks for this, its a really great solution to a problem that I have been pondering over fos some time!!!

    James

    Posted by James | October 8, 2009, 10:34 am
  15. MyAvatars 0.2

    You’re welcome James

    Posted by Joel | October 8, 2009, 5:16 pm
  16. MyAvatars 0.2

    Thanks for sharing this very helpful tip. It will definitely come in handy. :)

    Posted by Justin | October 14, 2009, 7:19 pm
  17. MyAvatars 0.2

    Greatest tip ever :)

    Posted by Marko | October 18, 2009, 4:29 pm
  18. MyAvatars 0.2

    I have finally found a “batch” that comes close to what I want to do. I have thousands of mp3 files in different folders by artist name. All I want to do is to make a list from the folders of all the files in the folders into one file and with NOT all the info (date, size, time, Dir of, , etc) Is that possible?

    Posted by Neil | October 19, 2009, 12:00 pm
  19. MyAvatars 0.2

    Excellent. Thanks

    Posted by Pan | November 2, 2009, 6:35 pm
  20. MyAvatars 0.2

    Wow!! That took all of 1 minute to create a list. THANK YOU!!!

    Posted by Ron | November 5, 2009, 12:21 pm
  21. MyAvatars 0.2

    You’re welcome :)

    Posted by Joel | November 5, 2009, 2:04 pm
  22. MyAvatars 0.2

    Thanks that was wonderful, I have been playing with it and driving my son nuts……1

    Posted by Terry | December 1, 2009, 5:36 am
  23. MyAvatars 0.2

    I am using the tool FileList Creator (freeware and portable) for creating lists of folders and files:

    http://www.sttmedia.com/filelistcreator

    With this tool you create such a list in a view seconds and you can set lots of other things like user-defined columns or grouping. The export is available as image, text file or HTML.

    Posted by Kathy | January 16, 2010, 5:42 pm
  24. MyAvatars 0.2

    Thank you so much! This will help me to organize my files and reduce the time I need to do make my reports! Great! : ) Thanks for sharing!

    Posted by Shirley Marie Bradby (English_For_You) | February 21, 2010, 5:09 pm

Post a comment