imreoliver@Foxpop

Imre Home Laptop/PC Palm General About me
 

Deepfolders - Quick Folder Lists for Windows XP

Let's feel pro and use the > (pipe) command.
Feb 2006

I ripped my classical music CDs onto the hard drive, so I can listen to it with my Creative mp3 player. I wanted to print a list of the music in Word, but typing all the album titles one-by-one was too slow. Here's the quick and easy way to generate a list of my music for the catalogue or for the backup-DVD cover.

How To Do It

Get to the command line interface: Start Menu\Run...\Open:, type in cmd and hit OK.
Alternative: in Total Commander, click Commands\Run DOS.

tc.rundos

Total Commander's Run DOS opens a command line window in the current folder.

Here we create a list with the dir command and redirect the output into a text file with the > (pipe) command.

I use four different listings, either folders only or folders and files, and with or without subfolders. Here you are the different commands for each:

  1. List all folders in the current folder
    dir /a:d /b > folders.txt
     
  2. List all elements (both folders and files) in the current folder
    dir /b > foldersandfiles.txt
     
  3. List all folders and subfolders (/s switch)
    dir /a:d /b /s > deepfolders.txt
     
  4. List all elements and all elements in subfolders
    dir /b /s > deepfoldersandfiles.txt

Then you can see the result with notepad (simply type notepad folders.txt and hit Enter). I like the best the first option, usually I make a quick list of my music collection this way for later edit, which is sorted into folders in the [artist - album title] format.

You can also copy-paste the commands from here, just use right click/Paste in the command line window.

folders.and.notepad

dir redirected with > into a text file.

I got something like this as a result:

folders.listed

The generated list using dir /a:d /b > folders.txt.

 

Tips

All the options of dir
To customize the results of dir, I used switches, which are described in help. Access it with dir /?.

dir.command.help.screen

dir command help screen

Set up batch files
Because I use very often these listings, I created small batch files and assigned them as commands to the Start Menu in Total Commander. Now, if I want to create a quick list of some folders on my hard drive, I just navigate there in TC and hit Start/folders.txt.


Easy edit in Word
To edit deepfoldersandfiles.txt in Word, I simply copy-paste the text from Notepad and switch to Web Layout view (View\Web Layout), because there are no line brakes that way.
To delete the leading C:\bla-bla-bla\ from the file structure, I select text holding down the Alt key. This way, I can select along a vertical line.

word.edit.deepfilesandfolders

Word edit of deepfilesandfolders.txt - Web Layout and vertical select with Alt.

'Open Command Window Here' Powert-Toy
There is a small add-on for Windows XP, which enables you to open a command window in the given directory from the context menu in Windows Explorer. Similar to 'Run DOS' in Total Commander. Download from here.

 

Last edited on 07-Jan-2007.

Top of Page

 

(c) Imre Oliver Kozak and @Foxpop.