Make the List of All File Names in a Folder

If you’re using Windows, this tip can save you time if you want to make a list of all the files present in a folder. DIR command of MS-DOS comes handy.

Although Windows operating system is not as powerful as UNIX/Linux when it comes to do non-conventional tasks –but still some of these not often performed tasks could be done on Windows.

One of such, rather uncommon, requirement arises when you need to create a list of all file names present in a folder / directory. The other day, I wanted to send my friend a list of songs that I have in the music folder in my computer. Creating such a list is very simple but there is no straightforward way to do this. Lets see how to go about it.

Open Windows Explorer and navigate to the folder whose content you want to list. Once you’ve opened this folder and are able to see its content – click on the location bar (where you see the path of your current folder) and press CTRL + C to copy the location path of your folder.

Go to Start button and type cmd in the “Search programs and files” box (If you are using Windows XP, click on Run option and type cmd in the resulting box). Press Enter.

A window with black background will appear on screen. This window is called Command Prompt. Don’t get afraid of the geeky look of this window –it is pretty harmless and easy to handle.

Type the following in the command window:

dir /s/w “

Now take right click anywhere inside the command window and select paste option from popup menu. This will paste the location of your folder that you had just copied.

Now close the double quote. By now the command will look something like:

dir /s/w “C:\mystuff\music”

To this add the following

> C:\mylist.txt

The command is complete now. Your final command should look like:

dir /s/w “C:\mystuff\music” > C:\mylist.txt

Press enter to execute the command and that’s it!

Go back to Windows Explorer and navigate to C:\ directory. Here you’ll find a new file called mylist.txt

Lalit Kumar is the Principal Author and Founder of TechWelkin. He is a web explorer and he enjoys finding useful information on the Internet. He loves to put things together to create a bigger solution. Lalit is passionate about technology, languages and literature. You can contact Lalit via email (techwelkin [at] gmail [dot] com) or Facebook (facebook.com/techwelkin).