How to get a list of files in a folder into Excel

In this post we will see how to get a list of files in a folder into Excel. We will show you how to use Excel to view Files and Folders details in Windows, by importing all files and folders details in to Microsoft Excel to keep track of file size, file type and last modified date.

We have many files and folders in our Windows PC and we may delete or add more files and folders frequently. There could be some folders and files which are very important to us and someone might edit them without our notice. But, we cannot keep on looking at each and every folder and file to know which one was edited. If it was modification of a file or folder, we can sort them by using ‘Last modified’ and we can get to know which were modified recently.

My files and folders

But, what if some of the files and folders were deleted from that directory? We would not be in a position to keep track of what were exactly deleted. But, you can use Excel to view files and folder details of directory which would be helpful to you to know at least the list of files and folders that were deleted.

How to get a list of files in a folder into Excel

Import and get a list of filenames into an Excel sheet

If you use Microsoft Excel to import all details of files and folders in to Excel, it will help you keep track of last modified date and time, file types, list of files, files size and many more regularly. To do this, follow these simple steps.

Move to the directory or folder on Windows File Explorer which you want to keep track of. Here, I want to keep track of my files and folders of Documents folder. Copy the path of that directory.

Directory path

Now, open any web browser of your choice and paste the copied path (Path of the folder you just copied in the previous step) in the address bar of the browser. I used Google Chrome here. Just prefix the URL by file:///and the content will be shown as the web page.

Contents of my directory

To save this web page as the offline copy, press CTRL+S or right-click on the web page and select “Save Page As”. Select the destination, give it a name and save the webpage.

save offline webpage

 

Now, via Windows Explorer go the location you saved the offline webpage and copy the path. The, open the Excel sheet and tap on the Data tab and click on From Web. It opens up the Window and in the Address bar paste the copied path and click “Go” button. It will load all the contents of the webpage.

Import from web

It shows you the yellow boxes with arrows and it will allows you to select the required frame. You can find here that I selected the part I want.

Select the frame

Once done with these steps, now click on import button and you see that all the files and folders details are imported to your Excel sheet in no time. You can see that, data is shown the columns and gives us the clear idea of every detail.

import files and folders details to excel

Conclusion

As we are engaged most of the time, in organizing files and folders, it is advisable to import files and folders details in to Excel. This would be helpful if any of your file or folder was to get deleted. The data in the Excel sheet does not refresh, so we need to import the data regularly. You can use this method, when to not only keep track of file changes, but also filenames.

Download this VPN to secure all your Windows devices and browse anonymously
Posted by on , in Category Office with Tags
Sridhar is a Software Engineer who loves to stay updated with developments in the world of technology. He is fond of writing everything related to Internet, Computers and Mobile and Desktop Operating Systems.

26 Comments

  1. Miguel Candelario

    Well, maybe it’s easier with oldschool DIR command ending with >filename.txt and then importing form Excel (in this case).

  2. Sridhar Belide

    Yeah it might be… but as excel lovers wants everything to be done using Excel, this method would be very useful!

  3. JBdisqusblip

    In Win7ro, this procedure does not work; only opens another folder window, no matter what I do to the fwd & bkwd slashes. I was able to use the CLI box “cd myusertestdi~1” and “help dir” and “dir/l/n/on/tw/w/x >..dirList.txt”
    It would be much better if there were a switch for tab separated columns, for insertion in Word & easy tabulation .

  4. as

    I think the folder/files listing function should definitely be integrated in Excel as a function.
    I don’t understand why MS doesn’t do so.

  5. Andrey

    Which method? One method requires the browser, the other requires the DIR command. What uses the dir command seems to require fewer steps.

  6. ReadandShare

    This might be easier: Once you have the index on your browser, simply copy and paste the list to your spreadsheet — in lieu of saving HTML file and then importing.

  7. Wynne Barnes

    I am wanting to create a list in excel of all graphics in a folder. I want the image to appear in the spreadsheet as well as the file type, image dimensions and image name. does anyone know of a way to do this. This post is the closest I have found when searching the internet,

  8. Hi Sridhar. Thanks for posting this. But I do have a question more, related to something I need in the following example:

    Is there a way (similar to this one) to get the list of 1119 files I have nested inside 383 folders rooted to a main folder (lets call it “X”)? What I’m aiming at is to just get the names of the files, not the folders…

  9. Lyan Kyaw

    Import button is disable.How to solve this problem?

  10. JimmyC

    I have numerous music albums, is there a way of opening up all the folders as well so that you get the folders and the files, and then do this trick?

  11. Mo

    Hi,

    Is there any possible way of searching list of files (list of
    files names or numbers provided in excel sheet) on PC D drive and extract them
    or transfer them to one folder location?

    Will appreciate if anyone has any solution/equation or Macro.

  12. yitzyy

    Using the browser method can be done in far fewer steps. You can highlight, then copy and paste into excel.

  13. Andrey

    If you redirect to text file (> filename.txt), just open the text file, highlight, then copy and paste into excel. Or open text file directly in excel.

    But if that is difficult, instead of redirecting to a file, just redirect to the clipboard using “dir |clip” or “dir /b /s |clip” command.

    Then just copy excel without wasting time highlighting and copying.

  14. gisela

    I followöed your instruction to transfer files to access. Everything worked fine, but the litte black arrow in a yellow square is disactived (there is a little red cross) and I find no way to activate it.

  15. YVONNE MOORE

    Thank you Sridhar!! This worked perfectly 🙂

  16. Jay

    Import button is disabled. How to activate it?

  17. Hammond Simmons Dan-Bob

    When I prefix the path for the folder that I want to Save with file:///, it does create the new page but it only displays part of the details. It’s missing 2 of the columns ( length and size) that were shown in the directory. In my case, I have a list of videos with names, date, type, size and length. How do I get all of this copied over??? Dan

  18. HOKBUN LEE

    Thank you, it works very well!! saved my day

  19. Just use command line.

  20. nitesh

    I was tried. it is doesnt worked. please let me know how to do use.

  21. Nausheen Shaikh

    I am also facing the same difficulty

  22. Nausheen Shaikh

    Import Button is disabled. Can anyone help me out with this?

  23. Bhargava Ramaraju

    SUUPER BRO THANK YOU VERY MUCH

  24. Thorsten

    even more easyer is “DIR >filename.csv” in CMD so you have it in excel rightaway!

  25. Cirro Germano

    Hi.By me doesn’t work with this (from above) method, because i simply can’t copy paste the URL adress.Maybe my Excel it’s the problem.Please tell me how can do it with DIR command.
    Thank you

  26. Ambar Canonicco

    I think this was perfect! Although I only used the first part, and then just did a copy and paste, paste as HTML

Leave a Reply

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


7 + 3 =