Home > General, Smart Tip > Print Folder and Directory Contents in Windows

Print Folder and Directory Contents in Windows

December 14, 2010 Leave a comment Go to comments

Scenario : You have a whole fat folder filled with ebooks and someone asks you to send over a list. A list… that sounds really simple or does it ??

Solution : It’s one of those simple tasks that suddenly come upon us and we have no idea how to go about it. Printing directory contents seems so mundane an activity that we forget it has very useful applications in our day to day usage. Especially in a professional setting where you might be told to send over a list of so and so files about such and such subject. If it’s a small bunch of files then manually writing it down is not a problem. But what if it numbers a few dozen?

So let’s work on not one but five ways to print folder and directory contents and get that file list.

Method 1 :  Via Command Prompt   : This method is very easy to use.

  1. Start the command prompt from Run – cmd. Type cd and write the directory path of the folder you want to list.
  2. Type dir > print.txt
  3. Press Enter and exit from the DOS window.
  4. Open the folder you wanted the listed file content for and you should see a print.txt file. This is a simple Notepad file that can be copied or printed easily.

Method 2 :  Setting A Contextual Menu  : If you want a more permanent and applicable to entire PC, you can add a  print directory feature to the right-click context menu for a folder. This sends the folder content list directly to the printer.


The below step is common for XP , Vista and Win7

1. Create a batch file in Notepad by pasting the following text

@echo off
dir %1 /-p /o:gn > “%temp%\Listing”
start /w notepad /p “%temp%\Listing”
del “%temp%\Listing”
exit

2.   Save the file as %windir%\Printdir.bat (This saves the batch file in Windows directory folder)

For Windows XP follow these steps:

  1. Open Control Panel – Folder Options. Click on the File Types tab. Under the registered file types select the entry for Folder. Click on Advanced. In the Edit File Type box, click on New. In the Action box, type Print Directory Listing. In the Application used to perform action box, type printdir.bat.
  2. Click on OK and close all boxes.
  3. Right-click on any folder and use the Print Directory Listing command to send the list to the printer.

For Windows Vista and 7, follow these steps :

  1. Click Start, click Run, type Notepad, and then click OK.
  2. Type the following commands in Notepad.
     

    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\Shell]
    @="none"
    
    [HKEY_CLASSES_ROOT\Directory\Shell\Print_Directory_Listing]
    @="Print Directory Listing"
    
    [HKEY_CLASSES_ROOT\Directory\shell\Print_Directory_Listing\command]
    @="Printdir.bat \"%1\""
    
    [HKEY_CLASSES_ROOT\SOFTWARE\Classes\Directory]
    "BrowserFlags"=dword:00000008
    
    [HKEY_CLASSES_ROOT\SOFTWARE\Classes\Directory\shell\Print_Directory_Listing]
    @="Print Directory Listing"
    
    [HKEY_CLASSES_ROOT\SOFTWARE\Classes\Directory\shell\Print_Directory_Listing\command]
    @="Printdir.bat \"%1\""
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\AttachmentExecute\{0002DF01-0000-0000-C000-000000000046}]
    @=""
    
    [HKEY_CLASSES_ROOT\SOFTWARE\Classes\Directory]
    "EditFlags"="000001d2"

     

     

    On the File menu, click Save As.

  3. In the Save in list, click Desktop.
  4. In the File name box, type PrintDirectoryListing.reg, click All Files in the Save as type list, and then click Save.
  5. On the desktop, double-click the LoggingOn.reg file to add the registry keys to the Windows registry.
  6. Click OK in the message box.

After completing the above steps, you will be able to see the below context menu whenever you right-click on a folder.

The above instructions can be found on the Microsoft Help and Support page.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: