DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 321379 - Last Review: August 2, 2013 - Revision: 11.0

This article was previously published under Q321379

On This Page

INTRODUCTION

This article describes how to add the Print Directory feature for folders in Windows XP, in Windows Vista, or in Windows 7. After you follow the steps that are described in the "More Information" section, you can right-click a folder and then click Print Directory Listing to print a directory listing of the contents of a folder. For more information about how to add the print directory feature for folders in Windows 2000, in Windows Server 2003 or in Windows Server 2008, click the following article number to view the article in the Microsoft Knowledge Base:
272623  (http://support.microsoft.com/kb/272623/ ) How to add the print directory feature to Windows Explorer


More information

To have us add the Print Directory feature for you, go to the "Fix it for me" section. If you prefer to add the Print Directory feature yourself, go to the "Let me fix it myself" section.

Fix it for me


To add the Print Directory feature automatically, click the Fix it button or link. Click Run in the File Download dialog box, and follow the steps in the Fix it wizard.
Collapse this imageExpand this image
Add the Print Directory feature (http://go.microsoft.com/?linkid=9751311)
Microsoft Fix it 50548
Collapse this imageExpand this image

Notes
  • This wizard may be in English only. However, the automatic fix also works for other language versions of Windows.
  • If you are not using the computer that has the problem, save the Fix it solution to a flash drive or a CD and then run it on the computer that has the problem.

Then, go to the "Did this fix the problem?" section.

Let me fix it myself

Windows XP

Step 1: Create the Printdir.bat file
To do this, follow these steps:
  1. Click Start, click Run, type notepad, and then click OK.
  2. Paste the following text into Notepad:
    @echo off
    dir %1 /-p /o:gn > "%temp%\Listing"
    start /w notepad /p "%temp%\Listing"
    del "%temp%\Listing"
    exit
  3. On the File menu, click Exit, and then click Yes to save the changes.
  4. In the Save As dialog box, type the following text in the File name box, and then click Save:
    %windir%\Printdir.bat
Step 2: Create a new action for file folders
  1. Click Start, click Control Panel, and then double-click Folder Options.

    Or, click Start, point to Settings, click Control Panel, and then double-click Folder Options.
  2. On the File Types tab, click File Folder.
  3. Click Advanced, and then click New.
  4. In the Action box, type Print Directory Listing.
  5. In the Application used to perform action box, type printdir.bat.
  6. Click OK.
  7. Click OK two times, and then click Close.
Step 3: Edit the registry
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756  (http://support.microsoft.com/kb/322756/ ) How to back up and restore the registry in Windows

After you follow the steps in the previous sections, Search Companion may start when you double-click a folder instead of the folder being opened. Or, if you have associated other actions with file folders, those actions may be performed instead.

To resolve this issue, follow these steps:
  1. Click Start, click Run, type Regedit and then click OK.
  2. Locate the following registry subkey:
    HKEY_CLASSES_ROOT\Directory\shell
  3. Click the value named Default.
  4. On the Edit menu, click Modify.
  5. In the Value data box, type none.
  6. Click OK.
  7. Exit Registry Editor.

Windows Vista or Windows 7

Step 1: Create the Printdir.bat file
To do this, follow these steps:
  1. Click Start, click Run, type notepad, and then click OK.
  2. Paste the following text into Notepad:
    @echo off
    dir %1 /-p /o:gn > "%temp%\Listing"
    start /w notepad /p "%temp%\Listing"
    del "%temp%\Listing"
    exit
  3. On the File menu, click Exit, and then click Yes to save the changes.
  4. In the Save As dialog box, type the following text in the File name box, and then click Save:
    %windir%\Printdir.bat

    Note If you receive a dialog box that says you don't have permission to save in this location, you can save the file to the desktop. Next, you click Start, click Run, type %windir%, and then click OK. Then, you can copy the file from the desktop to the location.
Step 2: Edit the registry
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756  (http://support.microsoft.com/kb/322756/ ) How to back up and restore the registry in Windows
  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 PrintDirectoryListing.reg file to add the registry keys to the Windows registry.
  6. Click OK in the message box.

Did this fix the problem?

  • Check whether the problem is fixed. If the problem is fixed, you are finished with this section. If the problem is not fixed, you can contact support (http://support.microsoft.com/contactus) .
  • We would appreciate your feedback. To provide feedback or to report any issues with this solution, please leave a comment on the "Fix it for me (http://blogs.technet.com/fixit4me/) " blog or send us an email (mailto:fixit4me@microsoft.com?Subject=KB) .

Applies to
  • Microsoft Windows XP Home Edition
  • Microsoft Windows XP Professional
  • Windows Vista Business
  • Windows Vista Enterprise
  • Windows Vista Home Basic
  • Windows Vista Home Premium
  • Windows Vista Starter
  • Windows Vista Ultimate
  • Windows 7 Enterprise
  • Windows 7 Home Basic
  • Windows 7 Home Premium
  • Windows 7 Professional
  • Windows 7 Starter
  • Windows 7 Ultimate
Keywords: 
kbenv kbhowtomaster kbfixme kbmsifaq kbmsifixme KB321379
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support