How to Easily Copy all Filenames in a Folder to Excel in Windows


In this short post, I’m going to show you how to easily copy all filenames in a Windows folder to Microsoft Excel.

First a caveat, the main limitation of this method I’m going to show you on how to copy file names into excel, is that you cannot copy filenames in subfolders. If you want to learn how to copy filenames in subfolders, check out the how to easily copy all filenames in a folder to Excel using CMD post.

Let’s jump right into it.

Step 1: Open Excel

Open up excel and then navigate to the folder that contains the files.

Step 1: Open Excel

Step 2: Navigate to Folder and Select All the Files

Navigate to the folder that contains the files.  In the folder that contains the files, select all the files in the folder. You can use the shortcut keys, Ctrl + a.

Step 2: Navigate to Folder and Select All the Files

Step 3: Hold Shift Key and Right Click

Now, holding the Shift key, hover over your selection and right click. Don’t let go of the Shift key before you right click.

Step 3: Hold Shift Key and Right Click

Alternatively, you can click on the Copy path icon that Microsoft have recently added to the Home tab of Windows Explorer, just below the cut icon.

Click on Copy Path in the Home tab of Windows Explorer

Step 4: Click Copy as Path                

In the window that pops up, click copy as path. This copies the file path of all the files to the Clipboard.

Step 4: Click Copy as Path

Step 5: Paste Filepaths in Excel

Navigate to Excel, I’m using ALT and Tab key, and paste the file paths.

Step 5: Paste Filepaths in Excel

Step 6: Use Replace Function in Excel

We are going to remove the folder path using find and replace function in excel and we’ll have the filenames.

So double click on one of the cells, select and copy the folder path. Click on Find and Select, scroll down to replace. Click on replace and paste the folderpath. Then click on replace all.

Step 6: Use Replace Function in Excel

Close the Find and Select dialog. Save your excel document and you have successfully copied all the file names in a folder into an excel document.

That’s it for this post, if you want to learn how to also copy the filenames into text check out this post on how to copy file names in windows explorer to text.

And here’s a short how-to video:

,

43 responses to “How to Easily Copy all Filenames in a Folder to Excel in Windows”

  1. […] You get the Microsoft windows operating systems, which comes with a Graphical User Interface, also known as GUI. Here’s a short post on how you can easily copy all filenames from a single folder in windows. […]

  2. Sunny Uberai Avatar
    Sunny Uberai

    Super tip

  3. bblontrock Avatar
    bblontrock

    After all those years, you would have expected Microsoft to have added a function to just copy the file names, not the paths.

    1. damian Avatar
      damian

      yes i want this too. copy just file names

  4. Anurag Hota Avatar
    Anurag Hota

    Excellent

  5. Joanne Avatar
    Joanne

    Thank you! worked perfectly and a big time saver.

  6. Mr. Dipp Avatar
    Mr. Dipp

    Thank you.

  7. Hugh Morrison Avatar
    Hugh Morrison

    Excellent, Thank you.

  8. Mirlan Karabukaev Avatar
    Mirlan Karabukaev

    Kongo, buddy, thanks a lot. you rock/

  9. Joe Avatar
    Joe

    this saved my life

  10. Aleksander Kowalnik Avatar
    Aleksander Kowalnik

    Thank You

  11. Happy Avatar
    Happy

    Thank you, brilliant, I knew how to get as far as Step 5 from wanting to save folder searches bfore but in those instances, I had wanted to keep the file path names so could locate them at later time.
    Step 6 was brilliant, I didn’t think this bit could be possible, only small issue is I couldn’t fully understand your instructions. When I zoomed in on my browser to 300%, I then could see on your image that only PART of the filepath was highlighted and to replace with ‘blank’ – once I could see the image, your explanation made sense and worked a charm!
    Thanks again

    1. Kongo Avatar

      Sorry to hear you found Step 6 was not clear. I may have overlooked that Excel find and replace was not “obvious.” Tend to happen after you’ve used a software for many years. And you are right, you replace the part of the filepath that is the folderpath with a blank and you have the filenames.

  12. supakit Avatar
    supakit

    Thank you! Kongo

  13. steve Avatar
    steve

    Neat!

  14. Roger Avatar
    Roger

    I do not see “Copy to Path” must be doing something wrong

    1. Kongo Avatar

      Step 3 – You need to hold the shift key while you right click on your file selection. Keep pressing on the shift key while you right click.

  15. Arthur Avatar
    Arthur

    Thanks for this, it worked Perfectly

  16. Anbu Avatar
    Anbu

    Thanks So much.

  17. Sampathkumar Avatar
    Sampathkumar

    i have copied 2000 word files from folder for the name creation works.
    its working perfect. thanks a lot.

    1. Kongo Avatar

      Glad you found it useful.

  18. Dumsane Avatar
    Dumsane

    Really helpful, thanks

  19. luis Avatar
    luis

    it worked fine
    thank you

  20. mshantz Avatar
    mshantz

    I would like to modify the file names and drop them back into file explorer. Is that possible? Thanks!

    PS. Or is there a better way to make mass modifications to file names in a folder?

    1. Kongo Avatar

      I don’t know of a way to rename the files from Excel.
      If you want to easily rename multiple files, check out this post on how to rename files using PowerShell. It will work for any consistent renaming of all types of files on Windows.

  21. Meghan Avatar
    Meghan

    Thank you thank you thank you!!!!

  22. ram Avatar
    ram

    Thanks. great help in simple way.

  23. Ankush Avatar
    Ankush

    You are a genius 🙂

  24. Amadeo Mifsud Avatar
    Amadeo Mifsud

    I’ve been using Explorer for decades now but never ever knew about the “Copy as path” command. Very, very useful. Thank you.

  25. Ron Person Avatar

    I was an original Beta tester for Excel and Windows (? 1984) and wrote the book Using Windows, which sold about a million copies. In all these years I never knew about the Copy as Path command.
    Outstanding! As another of your commentators said, This is an incredible time saver.
    Thanks.

    1. Kongo Avatar

      Glad you found it useful.

  26. shiva kumar m Avatar
    shiva kumar m

    wonderful bro helped a lot thank you

  27. Lina Espinosa Avatar
    Lina Espinosa

    Superb! Thank YOU!

  28. Mike Avatar
    Mike

    I don’t get the Copy as Path option when i do it

    1. Kongo Avatar

      Did you press and hold the Shift Key?

  29. Rob Avatar
    Rob

    The “find & replace” function didn’t work for me, possibly because my path is so long. I tried copy and paste into notepad and adding a tab space before the file name, but this didn’t transfer to excel as normal, the tab/space was ignored.

    I did find that if I deleted the ” before the C:/ and then put a tab space ahead of the file name pasting into excel worked properly and I could delete the path’s column leaving the file names.

  30. Suman Avatar
    Suman

    Thanks A Lot 🙂

  31. E.K Avatar
    E.K

    Wonderful, thank you so much for this instruction! Extremely helpful! 🙂

    1. Kongo Avatar

      Hi,
      I’m so glad you found the post uselful! Don’t be stingy, share it with your friends and colleagues!
      We can all benefit from the exchange of ideas.

  32. Muhammd Shahbaz Ali Avatar
    Muhammd Shahbaz Ali

    thanks alot.. good information

  33. Nerissa Avatar
    Nerissa

    Thanks a lot, pretty helpful! Just wondering about subfolders though?
    Like, I have a main folder and then probably 70 subfolders and I want to get the names of ALL the files in the subfolders. Is there an easier way to do this?

    oh, while I was asking, I did manage to do the above by using Excel >Data, but just wondering if you might have some cooler and better ways 🙂
    Thanks again!

    1. Kongo Avatar

      Check out the post on how to accomplish this using Command Prompt. You can also use PowerShell to achieve similar results.

  34. Madhav Avatar
    Madhav

    Quick and easy tip.

    Easy to understand beginner excel user.

Leave a Reply

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