Thursday, October 6, 2011

Command Line to save Directory Structure to a file

 I wanted to be able to save only the directories to a file.

Here is the command.

dir /A:D /S /B E:\Inetpub\wwwroot\Domains > e:\randyfiles.csv

/A:D -- Only show directories

/S -- Recurse through the directory and subdirectories

/B  -- Users the bare format.  1 directory per line