Windows 11’s File Explorer lacks a built-in option for copying a folder’s file list into a text file. You can manually select all files in a folder and select Copy as path to paste their directory paths into a file. However, that’s hardly an ideal way to set up a file list for a folder.

There are two good Windows 11 methods for copying file lists from folders into text files. One way involves entering a Command Prompt command. Another method requires you to set up a new context menu option for copying a folder’s file list to the clipboard.

How to Copy a List of File Names For a Folder With the Command Prompt

The Command Prompt is one of two command-line interpreters in Windows 11. You can utilize the Command Prompt to create a simple text document that includes all the files within a specific folder. No manual copying and pasting is required for this method. This is how you can extract a list of files for a folder via the Command Prompt in Windows 11.

  1. Click Windows 11’s magnifying glass taskbar icon.
  2. Type cmd in the search tool’s box.
  3. Select Command Prompt to open its window.
  4. First, open the folder to obtain a file list within the Command Prompt. To do so, enter cd\ followed by a folder path and press Return.
    The cd command
  5. Then input this command in the Prompt's window and press Enter:
            dir /b >filename.txt  
        
  6. Press the Win + E key combo, and open the folder for which you set up a file title list.
  7. You’ll find the file list text document you set up with the Command Prompt within that folder. Double-click the text file to open it.
A file name list for a folder

You can change the filename text in the command specified above with a different file name. However, the file name must include the .txt extension at the end of it.

The dir /b command

Read also: Fun Tricks You Can Do in Command Prompt

How to Set Up a Copy File List to Clipboard Option

The Command Prompt method above might be sufficient for some users. However, you can add a convenient Copy File List to Clipboard option to the context menu by tweaking the registry. Then you can simply copy a file list for a folder to the clipboard by selecting an option on the right-click menu. These are the steps for adding a Copy File List to Clipboard option to Windows 11’s context menu.

  1. Start Run by pressing the Win + R keyboard shortcut.
  2. Open the Registry Editor by typing regedit the Open box and clicking OK.
  3. Open the HKEY_CLASSES_ROOT\Directory\shell key location with the left navigation pane.
  4. Right-click the shell registry key to select New.
  5. Next, select Key to add one to the registry.
    The New and Key options
  6. Input copylist for a key title.
  7. Select the new copylist key, and double-click (Default) on the right of the Registry Editor.
  8. Type Copy File List to Clipboard inside the Value data box, and select OK to apply.
  9. Now you’ll need to add a subkey to the copylist key. Right-click copylist to select the New > Key registry options.
  10. Enter command in the text box.
    The command key
  11. Click the command key on the left of the registry editor to select it.
  12. Double-click the (Default) string for the selected command key.
  13. Input cmd /c dir "%1" /a:-d /o:n | clip in the Edit String window’s text box.
    The Value data box
  14. Select OK to apply the value and exit the window.
  15. Close the Registry Editor.

Now find a folder in File Explorer to copy a file list from. Right-click that folder and select Show more options. Click Copy File List to Clipboard on the classic menu.

The Copy File List to Clipboard option

You’ll still need to paste the copied list into a text file. Launch Run, type Notepad in the Open box, and click OK. Then press the Ctrl + V hotkey to paste the folder’s file list into Notepad.

A folder's file list

The Copy File List to Clipboard option provides a more detailed file list for a folder than the Command Prompt method. Aside from listing file names, the list includes their date and size details. It also tells you how many files there are in the folder. You can save the list by clicking File > Save as in Notepad.

You can remove the Copy File List to Clipboard context menu option by deleting its key. Open the Registry Editor, and return to the HKEY_CLASSES_ROOT\Directory\shell location. Right-click copylist to select its Delete option.

The Delete key option

Read also: What Is the Windows Registry and How Do I Edit It?

Keep Track of Your Folders’ Contents With File Lists

So, you don’t need any third-party Windows 11 programs to generate folder file lists. The methods above are pretty straightforward ways to copy file lists from folders into text documents in Windows 11. If you only need a basic list of files, the Command Prompt method will be fine. To copy more detailed folder file lists, add the Copy File List to Clipboard option to the context menu.