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 Folder details in Windows by importing all files and folder details into Microsoft Excel to keep track of file size, file type, and last modified date.
We have many files and folders on our Windows PC, and we may delete or add more files and folders frequently. Some folders and files could be very important to us and someone might edit them without our notice. But, we cannot keep on looking at every folder and file to know which one was edited. If it was a modification of a file or folder, we can sort them by using ‘Last modified’ and get to know which were modified recently.
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 was exactly deleted. But, you can use Excel to view files and folder details of a directory, which would be helpful to you to know at least the list of files and folders that were deleted.
Import and get a list of filenames into an Excel sheet
If you use Microsoft Excel to import all details of files and folders into 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.
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.
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.
Now, via Windows Explorer, go to the location you saved the offline webpage and copy the path. Then 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 the “Go” button. It will load all the contents of the webpage.
It shows you the yellow boxes with arrows and allows you to select the required frame. You can see here that I selected the part I wanted.
Once you have completed these steps, click on the Import button, and you will see that all the files and folder details are imported to your Excel sheet in no time. The data is shown in the columns, giving you a clear idea of every detail.
Conclusion
As we are usually engaged in organizing files and folders, it is advisable to import file and folder details into Excel. This would be helpful if any of your files or folders were 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 to keep track of file changes and filenames.
Well, maybe it’s easier with oldschool DIR command ending with >filename.txt and then importing form Excel (in this case).
Yeah it might be… but as excel lovers wants everything to be done using Excel, this method would be very useful!
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 .
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.
Which method? One method requires the browser, the other requires the DIR command. What uses the dir command seems to require fewer steps.
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.
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,
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…
Import button is disable.How to solve this problem?
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?
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.
Using the browser method can be done in far fewer steps. You can highlight, then copy and paste into excel.
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.
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.
Thank you Sridhar!! This worked perfectly :-)
Import button is disabled. How to activate it?
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
Thank you, it works very well!! saved my day
Just use command line.
I was tried. it is doesnt worked. please let me know how to do use.
I am also facing the same difficulty
Import Button is disabled. Can anyone help me out with this?
SUUPER BRO THANK YOU VERY MUCH
even more easyer is “DIR >filename.csv” in CMD so you have it in excel rightaway!
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
I think this was perfect! Although I only used the first part, and then just did a copy and paste, paste as HTML