Monday, August 5, 2013

Print the Contents of a Directory from Windows Command Prompt

Working with law firms, I often get tasked to list or index the contents of a Windows File Folder either from an external drive or a disk.  While Windows explorer makes this an easy task, they still do not make it simple for those needing to create a paper or even a simple text listing of the file and folder structure.  

While not likely that most end users will do it, you can complete a basic print out like this from a command prompt by doing the following.

  • Open the folder tree in question with Windows Explorer


  • Highlight the folders path and copy it to your clipboard.  In this case, the folder is on my desktop

  • Click Start, Choose Run and type CMD to bring up the command line.

  • Change the directory to the example folder.  Again this on my desktop so I used: cd\users\jsmith\desktop\example
  • Run the directory command with the option to print the file names and any other files in the directories in the current directory.  The results will be placed in plain text file in the same directory.