How to export file and folder structure to excel spreadsheet

Posted on 2010-09-07
Medium Priority
Last Modified: 2013-11-10

I need a script that I can run against file servers to export the folder structure and file lists to a spreadsheet or a csv file that I can import into a spreadsheet. We need to share this with management so they can decide what directories are mission critical.

Thanks in advance for your  help
Question by:Raymo12
  • 4
  • 2
LVL 60

Expert Comment

by:Bill Prew
ID: 33623179
Can you be more specific about what information you want in the file, like do you want size and date info, etc?  And do you want just folders, or files too?  And do you want to re-curse into subfolders and list those, or just summarize at the first level of folders?

LVL 93

Accepted Solution

Patrick Matthews earned 2000 total points
ID: 33623389

Please have a look at this past solution:

It contains code I've been using for years to output the contents of a directory to an Excel worksheet.  It includes the option of drilling into subfolders, if that's what you want to do.


Author Comment

ID: 33629480
billprew I actually don't need size and date just folders and files if possible. Pretty much management wants to see whats on each server and decide on a retention plan.

Thanks matthewspatrick I'll have a look at your solution and report back.
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Author Comment

ID: 33630774
mathewspatrick that is one sweet vb module! Is there anyway I can run it against a drive without selecting a folder? I'm trying to think of a way to list all the contents of Server A D:\drive as an example

LVL 93

Expert Comment

by:Patrick Matthews
ID: 33630846
All you should need to do is select the drive in the dialog box (see attached image).

If you select a drive, you can enumerate it.

Of course, if you choose to drill into the subfolders, you could run out of rows in your Excel worksheet :)


Author Comment

ID: 33631030
Yes, I meant if I were to want to run this on a remote server within the same network. Like browse to a server and it's drive. It seems to work if I map that drive first so that should be sufficient.

Thank you very much for your help!

Author Closing Comment

ID: 33631576

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Screencast - Getting to Know the Pipeline

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question