List of Files in Folder

This is an image of the Windows File Explorer and a small text file open in Notepad showing the list of files in editable text.

List of Files in Folder: a reader asks…

I have a Windows PC and I want to create a list of the files in a folder that I see in File Explorer. I know I can take a screenshot of that, but I end up with a picture – I need a list I can edit (e.g., text I can use in an email or word processing, etc.). How can I do that? What I want is a list of episodes of a TV show I have in my Music folder (which is on the E: drive in my computer).

This is certainly do-able, but it’s not as easy as it should be, Microsoft really dropped the ball on this. While there are a number of different ways to do this, the simplest way is to use the built-in PowerShell utility (which replaces the old Command Prompt window) and a simple command.

I’m going to use an example following your query, other readers can adjust this to whichever folder on your computer has the list of files you want. Here’s what you do:

Advertisement
  1. Open File Explorer and navigate to the folder that shows you the sub-folder which has the list of files you want. For example if the folder E:\Music\TV Shows\Heroes has the list of TV episodes you want, navigate to E:\Music\TV Shows.
  2. You’ll see the Heroes sub-folder in the File Explorer window. Hold down your Shift key and right-click on that Heroes folder entry. This brings up a menu – select (left-click) “Open PowerShell window here”. That opens a window with a blue background and a old command-prompt style “PS E:\Music\TV Shows\Heroes>”
  3. Click your cursor to the right of the >, then type “dir -n > filelist.txt” and hit your enter key. Be sure to include the spaces in that command.
  4. Now go back to your File Explorer window, and open the Heroes sub-folder. You’ll find a text file in it “filelist.txt” which you can open and then copy text and paste the list elsewhere.

If you instead have the Command Prompt, the actual command to type is slightly different. Use “dir /b > filelist.txt” which will give you the identical results as using the PowerShell command above. And of course, if your folder location and name is different substitute your own in the process above.

This is the example text file that has the file names from the folder.

When you execute the command (either way), you’ll get a plain text file that you can open in Notepad, and then copy the text to paste elsewhere. This will have just the file names (with their extension), however the files are named in your own folder.

As long as you’re starting the PowerShell or Command Prompt at the same point on your hard drive, you’ll not need to do any navigating within to get to where you want to be. If you have to run the Command Prompt from the search bar or Start menu (right-click the Start menu), then you’ll need to navigate using the CD [folder name] commands (see the Command Prompt window in the screenshot above).

If you search online for how to do this, you’ll get a lot of more involved and difficult ways to accomplish the same thing, using the older Command Prompt window. Older versions of Windows used Command Prompt instead of PowerShell, but any current Windows computer (Windows 10 or 11) will have PowerShell as the default option.

This website runs on a patronage model. If you find my answers of value, please consider supporting me by sending any dollar amount via:

Click or tap to open a new browser tab or your Venmo app and send money via Venmo to @positek
(@PosiTek)

Click or tap to open a new browser tab or your Paypal app to send money via your Paypal account to support@positek.net
(Support@PosiTek.net)

Click or tap to open a new browser tab or your Paypal app to send money using your credit card to support@positek.net (no Paypal account required)
(using any credit card)

or by mailing a check/cash to PosiTek.net LLC 1934 Old Gallows Road, Suite 350, Tysons Corner VA 22182. I am not a non-profit, but your support helps me to continue delivering advice and consumer technology support to the public. Thanks!

Leave a Comment

Your email address will not be published. Required fields are marked *

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

This site uses Akismet to reduce spam. Learn how your comment data is processed.