How To Generate A List Of Files Contained In A Windows Folder

THL Toolbox > Tips On Software & Operating Systems > Windows Tips > How To Generate A List Of Files Contained in a Windows Folder

How To Generate A List Of Files Contained in a Windows Folder

Contributor(s): Staff With a Mac it's easy to copy a list of files in a folder to a text document but difficult on Windows. Here is a way to do it.

You must first summon your DOS command prompt (Start Menu -> Run, enter "cmd", then hit return. Your DOS command prompt should then materialize.). In the DOS command prompt, navigate (by using "cd C:foldernamefoldername etc until you are there) to the level that contains the folder in question (do not navigate *into that folder); then type the name of the folder for whose contents you want to generate a file list, followed by a ">", then enter a name for the file to be created with the name of every file in the folder in question.

So in this case we take the contents of a hypothetical folder "temp", which in this case is in the top level of the C drive, and write it to a file called "filelist.txt". Here's how:

dir C:temp > C:filelist.txt

It's that simple. This is what you will then find as the contents of filelist.txt (i.e. these are the names of the files in our hypothetical folder "temp"):

Directory of C:temp

04/13/2004 01:52 PM <DIR> .
04/13/2004 01:52 PM <DIR> ..
03/12/2004 12:39 AM 1,343,488 01929_comics-2 .04.mp3
08/19/1998 11:25 AM 47,124 ALABAS__.TTF
08/18/2003 01:29 PM <DIR> rasterproxies
03/10/2004 02:54 PM 126
03/10/2004 02:52 PM 126
03/31/2004 07:15 PM 144
10/23/2003 04:28 PM <DIR> tm
10/23/2003 04:24 PM 196,781
6 File(s) 1,587,789 bytes
4 Dir(s) 12,923,981,824 bytes free

This page is provided courtesy of the external link: Tibetan and Himalayan Library.