Home > Tips and Tricks

How to Copy all the File Names inside a Folder in Windows [3 Methods]

In this guide, we will show you three different methods through which you could copy all the file names inside a folder on your Windows PC. If there are a couple of files lying around, then you could manually carry out this task. However, things begin to take turn for the worse when a slew of files are all lined up inside a directory. So rather than manually copy-pasting each of the file names, you could automate this entire process.

In this regard, there exist three different methods for the same. The first approach is via the context menu, then comes the Command Prompt, and finally, you have the Registry Editor. We have listed all these three methods below, along with their perks and drawbacks. So without any further ado, let’s get started with the guide to copying all the file names inside a folder on your Windows PC.

Copy all File Names inside a Folder via Context Menu

This method is the easiest to execute of the three that we have listed. However, it tends to copy the location of the files as well, along with their name. For some, it’s hitting two targets with a single arrow, but for others, it’s the addition of unnecessary information that they never asked for in the first place. If you belong to the former domain, then proceed ahead with the below steps. On the other hand, the second group of users might find the other two methods handier than this one.

  1. To begin with, head over to the desired folder.
  2. Then use the Ctrl+A shortcut to select all the files.
  3. After that, perform a right-click and select Copy as path.
    Copy all File Names inside a Folder
  4. Now open any text editor and press Ctrl+V to paste it.
    Copy all File Names inside a Folder
  5. You will now get the names of all the files along with their location.

Copy all File Names inside a Folder via CMD

This method does exactly what it says- copy all the file names inside a folder on your Windows PC, without adding any unnecessary details like file location, etc. Here’s how to try it out:

  1. Head over to the desired folder, go to its address bar, type in CMD, and hit Enter.
  2. Now execute the below command in that CMD window (you may replace ‘filename’ with any name of your choice):
    dir /b >filename.txt

    Copy all File Names inside a Folder

  3. You will now get a list of all the file names in a text file which will be saved inside that folder itself.
    Copy all File Names inside a Folder

Copy all File Names inside a Folder via Registry Editor

In this method, we will be adding the Copy File Names to Clipboard option in the right-click menu. So how is this different from the first method? Well, it will only copy the name of the file and not its location. Since we will be carrying out this task by tweaking the registry key, it is advised to take a backup of the registry beforehand.

  1. Head over to the Start Menu, search Registry Editor, and open it.
  2. Then copy-paste the below location in the address bar and hit Enter.
    HKEY_CLASSES_ROOT\Directory\shell

    Copy all File Names inside a Folder

  3. Now right click on the shell folder and select New > Key.
    Copy all File Names inside a Folder
  4. Name it copylist. Then open its Default file present on the right-hand side.
  5. Type in Copy File Names to Clipboard in its Value Data field and hit OK to save it.
    Copy all File Names inside a Folder
  6. Now right-click on copylist and select New > Key.
    Copy all File Names inside a Folder
  7. Name it command. Then open its Default file from the right-hand side.
  8. Type in the below command in its Value Data field and hit OK to save it:
    cmd /c dir "%1" /a:-d /o:n | clip

    Copy all File Names inside a Folder

  9. Now right-click on a folder, select Show More Options > Copy File Names to Clipboard.
  10. All the file names will be copied to the clipboard. You may now paste it to the desired file via Ctrl+V.
  11. [NOTE: To revert the change aka remove the Copy File Names to Clipboard option from the right-click menu, just delete the copylist key].
    Copy all File Names inside a Folder

With this, we round off the guide on how you could copy all the file names inside a folder on your Windows PC. We have listed three different methods for the same. Do let us know in the comments which one you ultimately decided to settle with. Likewise, all your queries are welcomed in the comments below.


Share: