How To List Files in a Directory in Windows
If you have a folder full of files in windows and you’d like a list of filenames, you may have wondered how the hell you can do it. Well, it’s easy. Here’s how it’s done.
1. Open up the directory in Windows Explorer and hold shift whilst right clicking somewhere within it (not on a file). From the context menu, select ‘Open command window here’.
2. You should see a console window open. Type the following line and hit ‘enter’:
dir *.* /b > files.txt
3. You should see a new file appear within your folder called ‘files.txt’. Open it up in notepad and there’s your list of files! (It also contains ‘files.txt’ listed within it, you might want to delete that line)
You can choose to show only certain filetype by changing the ‘*.*’ wildcard. The line below will show all JPG images:
dir *.jpg /b > files.txt
That’s it. It’s easy when you know how!
I use this trick all the time. I hope you find it as useful as I do.