Pin Me

Quickly Print a List of the Files in the Current Directory

written by: Lamar Stonecypher•edited by: Bill Fulks•updated: 11/6/2009

Have you ever needed a fast way to print a list of files in a particular folder? Windows Explorer has no easy method for doing this, but if you follow the steps in this detailed guide, you can add "Print Directory Listing" to the right-click menu for folders in Windows Explorer.

  • slide 1 of 27

    This guide addresses adding “Print Directory Listing” to the right-click contextual menu of folders in Windows Explorer in Windows XP. Information for this tip was obtained from Microsoft Knowledgebase articles 321379 and 322756. If you are using Vista and want this functionality, please see this article instead.

    Ready? Let's get started.

  • slide 2 of 27

    Part One: Creating the Right-Click Menu Item

    1. Click Start, All Programs, Accessories, Notepad.

    2. Paste in the following text:

    @echo off

    dir %1 /-p /o:gn > "%temp%\Listing"

    start /w notepad /p "%temp%\Listing"

    del "%temp%\Listing"

    exit

  • slide 3 of 27

    Image

  • slide 4 of 27

    3. Click File, Save As, and enter the following text in the Save As field:

    %windir%\Printdir.bat

  • slide 5 of 27

    Image

  • slide 6 of 27

    4. Click Save, and then exit Notepad.

    5. Click Start, Control Panel, and Folder Options.

  • slide 7 of 27

    Image

  • slide 8 of 27

    6. Click the Files Types tab and wait for the “Registered file types” field to populate.

  • slide 9 of 27

    Image

  • slide 10 of 27

    7. Click “File Folder” to highlight it, and then click the Advanced button.

    8. In the Edit File Type dialog, click New.

  • slide 11 of 27

    9. In the Action field, enter

    Print Directory Listing

    10. In the Application used to perform action field, enter

    printdir.bat

    11. Click OK twice and then click Close.

  • slide 12 of 27

    Image

  • slide 13 of 27

    This may complete the steps. Let’s find out. Double-click My Computer and your C: drive. Right-click a folder and you should see “Print Directory Listing” in the context menu. Try it out. If a command prompt box pops up followed by the print spool dialog, it worked.

    However, there’s one more thing to check. Double-click a folder and see if it opens. If instead, you get a Search Results box as shown below with the folder name you double-clicked shown in the “Look in” field, then you have other actions associated with your file folders. Fixing this will require a Registry edit, but don't worry. As always, we’re here to guide you and will take the cautious approach.

  • slide 14 of 27

    Image

  • slide 15 of 27

    Part Two: Setting a Restore Point to Back Up the Registry

    First, let’s back up the Registry by creating a System Restore Point.

    1. Click Start, then Run, and enter

    %SystemRoot%\system32\restore\rstrui.exe

  • slide 16 of 27

    Image

  • slide 17 of 27

    2. Click OK.

    3. Click “Create a restore point” and click Next.

  • slide 18 of 27

    Image

  • slide 19 of 27

    3. Give your restore point a meaningful name, and then click Next.

  • slide 20 of 27

    Images

  • slide 21 of 27

    4. Click Create and wait while Windows creates the restore point.

    5. Click Close.

  • slide 22 of 27

    Part Three: Fixing the Problem in the Registry

    The Registry was backed up as the restore point was created. Now we’re ready to edit the Registry to fix our problem with double-clicking a folder.

    1. Start the Registry editor by clicking Start, Run and entering “regedit”

    2. Navigate to HKEY_CLASSES_ROOT\Directory\shell

    3. With “shell” highlighted, double-click “Default” at top right.

  • slide 23 of 27

    Images

  • slide 24 of 27

    4. Enter “none” in the Value data field.

    5. Exit Regedit.

    And that’s completes the process.

    Try double-clicking a folder again, and it should open to the folder’s contents. Right-click a folder, and you should still have “Print Directory Listing” in the menu.

    Thanks for reading this.

  • slide 25 of 27

    Image

  • slide 26 of 27

    If you want to link to this article:

    http://www.brighthub.com/computing/windows-platform/articles/8924.aspx

  • slide 27 of 27

    Further Reading

    Turn Your XP Laptop into a Mobile Hotspot - Need to share your wireless or Ethernet connection with your colleagues? If they have Wi-Fi, it’s not difficult to set up a simple wireless network in Windows XP. Step-by-step we will show you how.

    How to Surf Anonymously - Get Lost in the Crowd with TOR - When you're surfing the web, every data packet your PC sends out can tell the wrong people what you're doing and with whom you're communicating online. One method of anonymity is getting "lost in the crowd." Here we'll show you how.

    The Best Free Streaming Music Discovery Websites - Are you still listening to the same music that you did when you were a teenager or young adult? If you’ve bought the same Eagles album on 8-track tape, cassette tape, CD, and from iTunes, it's time to give some new music a try. This article is for you.