How to create a text file listing of all files in a specific folder?

7

5

I have a large MP3 files collection that is about 80 GB, approximately 16000 songs. A friend of mine wants a list of my music to start a collection of his own. Bringing them over on an USB drive is not possible as we live in different continents and he has no problem gathering them on his own anyway.

Is there an easy way to get just the names of all files in a directory, without getting directory names too?

I don't mind installing software if it's needed, but I would prefer not to.

Dan Park

Posted 2009-09-11T02:57:47.737

Reputation:

Answers

22

You can use the dir command. First navigate to the folder with all of the files with command prompt, you can copy a directory from explorer and paste it in by right-clicking if you don't wish to type.

To exclude directory names but recurse into subdirectories:

dir /a-d /s *.mp3 > mp3s.txt

although the above will show hidden files (thumbs.db among other things from album art) so you may want to hide those:

dir /a-d-h /s *.mp3 > mp3s.txt

both of the above approaches will make a text file called mp3s.txt in your mp3 folder.

For a GUI approach, you can use DirPrint, The How-To Geek recently wrote an article on it:

enter image description here

John T

Posted 2009-09-11T02:57:47.737

Reputation: 149 037

add a "/b" to that to get just the file names (with path). This makes it much easier to parse later. – Doresoom – 2010-10-14T16:11:04.877

i think you will also need a /s to include sub-directories – Antony – 2009-09-11T03:24:37.043

And use "dir /a-d-h /s *.mp3 > mp3s.txt" to filter out everything this is not a MP3 (if any) – Snark – 2009-09-11T03:26:21.050

By how the question was worded I assumed they were all in a single folder, but a very valid point. Both suggestions taken into consideration to improve the answer. – John T – 2009-09-11T03:29:26.737

16000 files in one folder? i hope not... – Antony – 2009-09-11T03:31:47.763

2Ya never know these days. My grandma had a single folder of over 25000 high quality images from a digital camera and called me over because the computer would lock up trying to open the folder. Trying to draw thumbnails from all of those takes ages so I had to move about 500 at a time to subfolders so she could manage them. Thank god for Linux LiveCDs, head -n 500 | xargs mv ..\Folder1 and so on :) – John T – 2009-09-11T03:48:43.873

@Antony - Why ? AFAIK on modern windows there is no (within reason) limit to the number of files in a folder. – Rook – 2009-09-12T14:25:55.933

9

For those who use Total Commander, there are menu items for this:

  • Copy Selected Names To Clipboard
  • Copy Names With Paths To Clipboard
  • Copy to Clipboard With all Details
  • Copy to Clipboard With Path+Details

It's in the Mark menu and work with selected files. Select them all ("+" on the numeric pad, "*.mp3" as filter) if you need to copy the names of all MP3 files in the directory.

Snark

Posted 2009-09-11T02:57:47.737

Reputation: 30 147

1that's true, i came accross 4 or 5 question today where Total Commander would be a fine choice. truly a 'Jack of All Trades'! :) +1 – None – 2009-09-11T03:49:12.517

1@Molly I see you have a soft spot for Total Commander :) – alex – 2009-09-11T06:06:19.603

4

The JR Directory Printer utility allows you to print a listing of every subdirectory and/or file contained within a directory and/or subdirectory. It supports lowercase/dos style filename, file size in KB/bytes, attributes, custom file length, etc.

enter image description here

The result displayed in NotePad or default text editor as "dirprint.txt" file. This file is created in "JR Directory Printer" installtion folder, each time you click "Start" button.

Options:

  • Check Recurse Sub-directories option to see a complete list of all subdirectories and all files in all directories.

  • The Lowercase Filename option will force all file names into lowercase regardless of the actual file name.

  • DOS style filename option will limit the file name length within 8 chars.

  • Display Sub-directories will result in a list of all subdirectories contained under the selected directory along with a list of all individual files contained under the root directory. It will not list all subdirectories or individual files contained in the main subdirectories. To see a complete list of all subdirectories and all files in all directories, you would check the Recurse Sub-directories option and click on the Start button. This would rewrite the"dirprint.txt" file using the new options.

  • You can limit length file names so that they fits properly in list. By default this value is 35 chars.

  • You can check/uncheck Display Size, DateTime and Attributes option to list/unlist the file size, modified date/time and file attributes (a - Archives, r - Read Only, s - System, h - Hidden).

Molly7244

Posted 2009-09-11T02:57:47.737

Reputation:

keep in mind he needs to filter out directory names too, not sure if it has an option for that but by the looks of it I don't think so. – John T – 2009-09-11T03:06:02.773

not to be seen in this screenshot, but under the Display Tab, clear the box 'Sub-directoriies' and they won't be listed. you can also remove other info such as 'file size' 'date & time' and 'attributes'. and the length of the file name can be limited too. – None – 2009-09-11T03:45:03.553

1and of course you can make it 'portable'. just rip the installer with Universal Extractor, quite handy. – None – 2009-09-11T03:47:23.533

3

If you have Winamp, there's an option to save a playlist as an HTML page with all the songs in the playlist. That way, if your songs are labeled ok, you'll have a nicely formatted list, with no folder names.

alex

Posted 2009-09-11T02:57:47.737

Reputation: 16 172

1

FreeCommander would be my weapon of choice to do this. Folder --> Make Folder List. Alos has options to copy selected files to clipboard. Great tool and it's free.

jcollum

Posted 2009-09-11T02:57:47.737

Reputation: 3 737