How to print a list of contents of a Folder/Directory

Posted on 10 February, 2007
This item is filed under [Tips & Tricks, Windows XP]

February 10, 2007 · 2 comments

There is no direct way in Windows to make a list of the contents of a folder. If the contents are very limited you can probably just type out a list. But what if there are lots of contents, for example a multi-GB music folder?

Here is what you can do if you need to print out a list of the contents of such folders. You can create a small batch file, and then add it to the right-click context menu, so that all you will have to do is right-click and select Print Directory Contents (or whatever text you want).

First, open Notepad, and type in the following:

@echo off
dir %1 /o:g>c:\directory.txt
start/w notepad/p c:\directory.txt
del c:\directory.txt
exit

Save this in the root of the C drive as print_directory.bat. Now, in order to add this option to the right-click context menu, you will need to edit the default folder properties. In Windows Explorer, go to Tools > Folder Options > File Type. Click on the File Folder file type and then click on the Advanced button at the bottom right. Now, click on the New button. In the Action field, enter the name of the action, such as Print Directory or Print Contents, and in the Application to be used to perform this action field, fill in C:\print_directory.bat. Click OK three times and then close to exit.

Before you do anything, check to see that if you double-click a folder it actually opens normally, because sometimes the Search function gets set as default. You really don’t want to have to right-click every folder and select Open. So let’s fix this first:

Open the Registry Editor and navigate to HKEY_CLASSES_ROOT\Directory\shell\. Edit the default value (which might have changed to “Open” or “Find”) and change it to Explorer.

Now make sure you can double-click and open folders again, and then you’re ready to test the Print Contents / Directory command you just made. Right-click on a directory and select “Print Directory (or whatever you called it). You will get a pop-up that will ask you where to save “directory.mdi”. This is the Microsoft Document Imaging format, which makes a nice, neat and readable file that will list out the contents of the directory, and then save it. It will open with Microsoft Office Document Imaging.

Enjoyed this post? Share it with others.
  • email
  • Print
  • Digg
  • StumbleUpon
  • Technorati
  • Reddit
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • FriendFeed
  • BlinkList
  • Diigo
  • LinkedIn
  • Propeller
  • IndianPad
  • MySpace
  • Slashdot

Subscribe Now

If you enjoyed this post, you will definitely enjoy our others. Subscribe to the feed to get future posts delivered right to your mailbox or feedreader.

Powered by Thesis

Thesis Theme

An amazing WordPress Theme, nothing beats the versatility and SEO friendliness of the Thesis framework.

From beginners, to the most advanced WordPress developers, Thesis makes it easy for anyone to customize it.


{ 2 comments… read them below or add one }

Elango October 22, 2008 at 12:36 pm

Hi,

is this not good one?

dir >list.txt

Reply

Vince July 23, 2010 at 6:45 am

Is Folder Printer is good to print directory contents

Reply

Leave a Comment

Previous post:

Next post: