Generate a comprehensive directory of all folders within a specified location using the Windows command prompt. Utilise this inventory of current folders and files to efficiently reorganise your shared drive or identify and remove ROT (redundant, Obsolete, and Transitory records). Understanding the contents of your system is crucial for identifying outdated, excessively nested, or inadequately named folders and files.

Steps
Launch File Explorer on your Windows device. Go to the directory where the folders you want to include in your list are located. To access the command prompt, right-click on the explorer, select Open in Terminal context menu and hit Enter.

This should open a black-and-white command prompt displaying the above file path.

Type dir /A:D /B > FolderList.txt and press Enter to generate a top-level folder list. When the list is complete, a new, blank prompt with a flashing cursor will appear.
Substitute dir /B > FolderList.txt to include files as well as folders.
Substitute dir /A:D /B /S > FolderList.txt to produce a list of all folders and all subfolders of the directory.
WARNING: This can take a while if you have a large directory. Be patient and do not close the command prompt window until it finishes and a new, blank prompt with a flashing cursor appears again.

A new text file called FolderList should now be in the below directory. Close the command prompt window and return to File Explorer.

Double-click that file to open it in Notepad to view a list of folders in that directory. Copy the contents into a Word document or Excel spreadsheet to add columns or further format.

Notes
- The command prompt uses an older method of alphabetizing folders; you may need to rearrange some folders in your list in order to match the sort order that appears in File Explorer.
- When you type the command into the command prompt, you can change the output file name to whatever you like but you must include the .txt at the end.



