Link to home
Start Free TrialLog in
Avatar of Chris Williams
Chris WilliamsFlag for United States of America

asked on

how to export folder and subfolder structure into an excel spreadsheet

I would like vb script / macro on exporting folder structure, including subfolders into an excel file. I do not necessarily need the folder names at this point. Just a file structure.
Avatar of Alan Gunn
Alan Gunn
Flag of United Kingdom of Great Britain and Northern Ireland image

If you use tree /a (A for ASCII) it will extract the folder structure.

You coud try
tree /a >mytreetextfile.txt

and then open the text flie in Excel.


You could also use

dir /b /ad /s

/b - Bare. No headers etc
/ad Attribute directory (That's what folders used to be called  ;-)

/s Subdirectory

Use
dir /b /ad /s >bigdirectorystructure.txt  

To capture the results.

ASKER CERTIFIED SOLUTION
Avatar of Chris Williams
Chris Williams
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's neat. :-)

I still use the tricks I learned before I knew any VB. :-)

The "dir /b /ad /s > folderstructure.txt" from the command prompt gets the results that end up in col B.

Cheers!

TRM
Avatar of Chris Williams

ASKER