Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Need to export list of all folders and sub-folders

Posted on 2013-11-11
Medium Priority
Last Modified: 2013-12-30
What are my options to create an export file that shows all sub-folders under a top level folder?
Question by:iNetSystem
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 96

Accepted Solution

Lee W, MVP earned 2000 total points
ID: 39640589
If I understand what you're asking for, open a command prompt and type:

dir /ad /b /s x:\ > file.txt


X:\ is the root of the drive you want (C:, D:, etc)
file.txt is the name of the text file you want to use to save this export.

Author Comment

ID: 39640592
Hi -

Let's assume the D volume on a server has a folder named IT.  I would like to export to a text file but a CSV is preferred all folders and sub-folders under the IT folder.  I don't care to list any files, I only need to see the folder structure.
LVL 96

Expert Comment

by:Lee W, MVP
ID: 39640604
Did you try the command I suggested?  What part are you having difficulty with... perhaps I could clarify...
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.


Author Comment

ID: 39640618
I did try that but it is not getting below the first level of sub-folders.  for each sub folder there can be several levels below that.

Author Comment

ID: 39640624
Actually it seems to have worked.

Author Comment

ID: 39640629
the order of the folders seems to be random - it's not everything I wanted but will work.

LVL 96

Expert Comment

by:Lee W, MVP
ID: 39640673
Change the order - add /o

dir /ad /b /s /o x:\ > file.txt

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

721 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