Creating a list of File Names in a Directory in Command Prompt

To create a list of all the files in a certain directory is to open up cmd and type:

 cd /d "[the location the directory is]"
dir /b > "[location you want to save the .txt file].txt"

So For example I wanted to create a list of all the song names in my Metallica album “Master of Puppets” I would do:

 cd /d "D:\Music\Metallica\Master of Puppets"
dir /b > "D:\Master of Puppets.txt"

Which outputs:

 01 Battery.mp3
 02 Master of Puppets.mp3
 03 The Thing That Should Not Be.mp3
 04 Welcome Home (Sanitarium).mp3
 05 Disposable Heroes.mp3
 06 Leper Messiah.mp3
 07 Orion [Instrumental].mp3
 08 Damage, Inc.mp3 

If you want more information over the files like when they were created or size or a summary of the folder then do not use the “/b” when doing the dir command.
If you want to do more than one directory say, you wanted to create a list of all songs in the the entire metallica directory which contains all the albums then you could cd to the parent directory in this case it would be D:\Music\Metallica, and do dir /b /s > Metallica.txt.
The downside to doing this is that it will show the path of the files as well (that way you know which album the song belongs too. Which might not be what you want if your trying to keep a nice and clean log you could easily copy and paste from. In that case you would just be better off creating a .txt for each album individually.

-flyingpengwin

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s