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.
Table of Contents
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.
- To begin with, head over to the desired folder.
- Then use the Ctrl+A shortcut to select all the files.
- After that, perform a right-click and select Copy as path.
- Now open any text editor and press Ctrl+V to paste it.
- 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:
- Head over to the desired folder, go to its address bar, type in CMD, and hit Enter.
- Now execute the below command in that CMD window (you may replace ‘filename’ with any name of your choice):
dir /b >filename.txt
- 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 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.
- Head over to the Start Menu, search Registry Editor, and open it.
- Then copy-paste the below location in the address bar and hit Enter.
HKEY_CLASSES_ROOT\Directory\shell
- Now right click on the shell folder and select New > Key.
- Name it copylist. Then open its Default file present on the right-hand side.
- Type in Copy File Names to Clipboard in its Value Data field and hit OK to save it.
- Now right-click on copylist and select New > Key.
- Name it command. Then open its Default file from the right-hand side.
- 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
- Now right-click on a folder, select Show More Options > Copy File Names to Clipboard.
- All the file names will be copied to the clipboard. You may now paste it to the desired file via Ctrl+V.
- [NOTE: To revert the change aka remove the Copy File Names to Clipboard option from the right-click menu, just delete the copylist key].
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.