Jump to content
Sign in to follow this  
morbidbutterfly

How to Print a Folder File List from Windows Explorer

Recommended Posts

Thanks to:

Gizmo

Ian Richards

Senior Editor, WindowsSecrets.com

 

How to Print a Folder File List from Windows Explorer (Does not work on Vista)

 

It's often useful to print the names of all the files in a folder, but this capability is not built into Windows by default.

 

Some third party file managers offer this function and there are some specialist utilities that will do the job as well.

 

But what most people don't realize is that you can set up Windows to do the job without having to use other utilities. In this article I'll show you how.

 

This technique makes use of the fact that good old DOS can print a folder file listing. All you do is use a DIR command and redirect the listing to your printer rather than your screen.

 

Don't panic! I'm not going to ask you to run DOS from the command windows. There is an easier way.

 

All you need do is create a batch file using Notepad or other plain text editor and then configure Windows to run the batch file from Windows Explorer right click context menu.

 

Microsoft has a knowledge base article [1] explaining exactly how to create and use the batch file and full instructions on integrating this into Windows Explorer.

 

Unfortunately, the KB article leaves out one step in the instructions, so I've reproduced a modified version of the KB article below:

 

To add the print directory feature to Windows Explorer, follow these steps:

a) Open Notepad and then copy and 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

 

B) Save the file as Prin.bat in the Windows directory, and then close Notepad.

 

c) Start Windows Explorer, click Tools, and then click Folder Options.

 

d) Click the File Types tab, and then click File Folder. d1)Click Advanced (this step added by Gizmo)

 

e) Click Edit, and then click New.

 

f) In the Action box, type Print Directory Listing.

 

g) In Application used to perform action, click Prin.bat, and then click OK.

 

h) Click OK, click Apply, and then click OK.

 

Now Open Windows Explorer, right-click the folder that you would like to print a directory listing of, and then click Print Directory Listing.

 

That's it. The print directory feature has been permanently added to your copy of Windows

 

[1] http://support.microsoft.com/?kbid=272623

Edited by morbidbutterfly

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for the tip. I wonder if you can help me.

 

I followed your directions and it placed the print option in the right click menu of all my folders, however, it placed that option at the top so that if I double click on a folder it prints the listing of the items in that folder.

 

Can you please tell me how to move it down or how to remove this option so that I don't go crazy inadvertently double clicking on folders and killing trees? :-)

 

Thank you

 

Larry

 

 

 

 

 

 

---------------------------------------------------

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for the tip. I wonder if you can help me.

 

I followed your directions and it placed the print option in the right click menu of all my folders, however, it placed that option at the top so that if I double click on a folder it prints the listing of the items in that folder.

 

Can you please tell me how to move it down or how to remove this option so that I don't go crazy inadvertently double clicking on folders and killing trees? :-)

 

Thank you

 

Larry

---------------------------------------------------

 

I don't quite understand what you mean?

 

morbidbutterfly

Share this post


Link to post
Share on other sites

I just made a change...

 

This part.

@echo off

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

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

-> This will open the notepad and automatic the print box, if you like to open just the notepad, so, you can copy and paste to anywhere, just remove the "/p"

del "%temp%\Listing"

exit

 

Once you have the notepad opened you can copy the text to anywhere, print, edit, etc.

One little detail, as far you keep the notepad opened, a black window will remain opened, once you close notepad it will just go away.

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for the tip. I wonder if you can help me.

 

I followed your directions and it placed the print option in the right click menu of all my folders, however, it placed that option at the top so that if I double click on a folder it prints the listing of the items in that folder.

 

Can you please tell me how to move it down or how to remove this option so that I don't go crazy inadvertently double clicking on folders and killing trees? :-)

 

Thank you

 

Larry

---------------------------------------------------

 

ok larry... i think what you are saying is you have the print directory set as default... heres a pic if you aren't sure what i mean. Posted Image

 

all you need to do is go back into that screen and click on open, then click the "set as default" button and you are now good.

Edited by phill.freeman

Share this post


Link to post
Share on other sites

Thanks to:

Gizmo

Ian Richards

Senior Editor, WindowsSecrets.com

 

How to Print a Folder File List from Windows Explorer (Does not work on Vista)

 

It's often useful to print the names of all the files in a folder, but this capability is not built into Windows by default.

 

Some third party file managers offer this function and there are some specialist utilities that will do the job as well.

 

But what most people don't realize is that you can set up Windows to do the job without having to use other utilities. In this article I'll show you how.

 

This technique makes use of the fact that good old DOS can print a folder file listing. All you do is use a DIR command and redirect the listing to your printer rather than your screen.

 

Don't panic! I'm not going to ask you to run DOS from the command windows. There is an easier way.

 

All you need do is create a batch file using Notepad or other plain text editor and then configure Windows to run the batch file from Windows Explorer right click context menu.

 

Microsoft has a knowledge base article [1] explaining exactly how to create and use the batch file and full instructions on integrating this into Windows Explorer.

 

Unfortunately, the KB article leaves out one step in the instructions, so I've reproduced a modified version of the KB article below:

 

To add the print directory feature to Windows Explorer, follow these steps:

a) Open Notepad and then copy and 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

 

B) Save the file as Prin.bat in the Windows directory, and then close Notepad.

 

c) Start Windows Explorer, click Tools, and then click Folder Options.

 

d) Click the File Types tab, and then click File Folder. d1)Click Advanced (this step added by Gizmo)

 

e) Click Edit, and then click New.

 

f) In the Action box, type Print Directory Listing.

 

g) In Application used to perform action, click Prin.bat, and then click OK.

 

h) Click OK, click Apply, and then click OK.

 

Now Open Windows Explorer, right-click the folder that you would like to print a directory listing of, and then click Print Directory Listing.

 

That's it. The print directory feature has been permanently added to your copy of Windows

 

[1] http://support.microsoft.com/?kbid=272623

 

 

 

 

Please tell me how to reverse this! I added the print option to "file folder" instead of "folder", and now I am having the same problem, that is, double clicking causes automatic printing!!!! There is no "open" option for file folders. I just want to reverse this.....PLEASE help!!! :pullhair:

Share this post


Link to post
Share on other sites

Please tell me how to reverse this! I added the print option to "file folder" instead of "folder", and now I am having the same problem, that is, double clicking causes automatic printing!!!! There is no "open" option for file folders. I just want to reverse this.....PLEASE help!!! :pullhair:

 

sorry... im on my way to work... otherwise i would give you a walk through... this site : http://windowsxp.mvps.org/context_folders.htm should help.

 

!!! WARNING!!! contains registry hacks, which could make your computer inoperable. if you do not feel comfortable doing this, or do not fully understand STOP and do not touch until you fully understand what you want to do.

 

come back and let me know... you can email me at phil.freeman@hotmail.com if you want any more help. in 8 hours i will be checking this forum again.

Share this post


Link to post
Share on other sites

sorry... im on my way to work... otherwise i would give you a walk through... this site : http://windowsxp.mvps.org/context_folders.htm should help.

 

!!! WARNING!!! contains registry hacks, which could make your computer inoperable. if you do not feel comfortable doing this, or do not fully understand STOP and do not touch until you fully understand what you want to do.

 

come back and let me know... you can email me at phil.freeman@hotmail.com if you want any more help. in 8 hours i will be checking this forum again.

 

 

 

Found this on Microsoft: http://support.microsoft.com/kb/321379

 

It worked for me!! :)

Share this post


Link to post
Share on other sites

Well what seemed like a good idea has now, unfortunately, screwed up my system.

 

I applied these changes last night and all seemed ok. When I right-clicked there was the new option immediately below the default of Open.

 

Today when I double-clicked on a folder the Windows Search came up instead !

 

Right-clicking showed that find was now the default option ! Strange.

 

Like a fool I found another Open option in the Folder file type, selected Edit, and copied the link from there which was something like Run32... something...dll.... blah blah and ended with a /i and put it in the File Folder list.

 

That, of course now tries to open the folder as an internet link.

 

BUT.... my problem is that now I can't change anything ! There is no Edit or Remove option available.

 

Help !..... I have brought work home with me that I need to do tonight (UK Time) and I can't use my machine.....

Share this post


Link to post
Share on other sites

Well what seemed like a good idea has now, unfortunately, screwed up my system.

 

I applied these changes last night and all seemed ok. When I right-clicked there was the new option immediately below the default of Open.

 

Today when I double-clicked on a folder the Windows Search came up instead !

 

Right-clicking showed that find was now the default option ! Strange.

 

Like a fool I found another Open option in the Folder file type, selected Edit, and copied the link from there which was something like Run32... something...dll.... blah blah and ended with a /i and put it in the File Folder list.

 

That, of course now tries to open the folder as an internet link.

 

BUT.... my problem is that now I can't change anything ! There is no Edit or Remove option available.

 

Help !..... I have brought work home with me that I need to do tonight (UK Time) and I can't use my machine.....

 

 

all you need to do is go back to the "edit file Type" window and highlight open then click on the button to the right that says set as default.

Edited by phill.freeman

Share this post


Link to post
Share on other sites

Did you try use the system restore? it should back your system to the last settings.

 

Hi... yes, I had already tried going back a couple of days, but it said that no changes had occurred so that there was nothing to restore. But thanks anyway.

Share this post


Link to post
Share on other sites

all you need to do is go back to the "edit file Type" window and highlight open then click on the button to the right that says set as default.

 

Hi Phill,

 

No you've missed the point...

 

I don't have a problem setting it as the default, but because I have changed what it does when it tries to use the "Open" option I need to Edit that, and the Edit... option on that panel is not available.

 

I have had a careful look around at some of the other Extensions and it is noticeable that the Edit... option is not available on some of the others, and in all those cases the "Change Icon" is also protected. Where "Change Icon" <b>is</b> allowed then so is the Edit...

 

For some reason the options in "File Folder" are now protected.

 

In the meantime I'm using Search from the Start button whenever I want to open a specific file but, hopefully, that is only a temporary solution.

Share this post


Link to post
Share on other sites

It OK, problem solved.

 

I did a load of research on the web and in my Registry and finally found a site that suggested I run....

 

regsvr32 /i shell32

 

This worked for me, Phew !

 

Now I feel much more comfortable. Thanks for your time.

Share this post


Link to post
Share on other sites

Thanks to:

Gizmo

Ian Richards

Senior Editor, WindowsSecrets.com

 

How to Print a Folder File List from Windows Explorer (Does not work on Vista)

 

It's often useful to print the names of all the files in a folder, but this capability is not built into Windows by default.

 

Some third party file managers offer this function and there are some specialist utilities that will do the job as well.

 

But what most people don't realize is that you can set up Windows to do the job without having to use other utilities. In this article I'll show you how.

 

This technique makes use of the fact that good old DOS can print a folder file listing. All you do is use a DIR command and redirect the listing to your printer rather than your screen.

 

Don't panic! I'm not going to ask you to run DOS from the command windows. There is an easier way.

 

All you need do is create a batch file using Notepad or other plain text editor and then configure Windows to run the batch file from Windows Explorer right click context menu.

 

Microsoft has a knowledge base article [1] explaining exactly how to create and use the batch file and full instructions on integrating this into Windows Explorer.

 

Unfortunately, the KB article leaves out one step in the instructions, so I've reproduced a modified version of the KB article below:

 

To add the print directory feature to Windows Explorer, follow these steps:

a) Open Notepad and then copy and 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

 

B) Save the file as Prin.bat in the Windows directory, and then close Notepad.

 

c) Start Windows Explorer, click Tools, and then click Folder Options.

 

d) Click the File Types tab, and then click File Folder. d1)Click Advanced (this step added by Gizmo)

 

e) Click Edit, and then click New.

 

f) In the Action box, type Print Directory Listing.

 

g) In Application used to perform action, click Prin.bat, and then click OK.

 

h) Click OK, click Apply, and then click OK.

 

Now Open Windows Explorer, right-click the folder that you would like to print a directory listing of, and then click Print Directory Listing.

 

That's it. The print directory feature has been permanently added to your copy of Windows

 

[1] http://support.microsoft.com/?kbid=272623

 

I did tis but when I get to "advanced" the edit box is greyed out.

Share this post


Link to post
Share on other sites

I did tis but when I get to "advanced" the edit box is greyed out.

Don't bother with folder options, Alfred, or you'll end up having folders not open when double-clicked.

 

First, let's correct the Prin.bat file.  Click Start, Run, type notepad %windir%\Prin.bat and click OK to open the file.  Edit it to read

 

@echo off

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

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

del "%temp%\Listing"

 

This removes the uneeded exit and the meaningless /-p switch.  Click File, Edit, and Yes to save the file.

 

Now onto the rest.  Click Start, Run, type Notepad SetPrin.bat and click OK.  Click Yes to continue.  Copy & paste this line.

 

@Reg Add "HKCR\Directory\shell\Print Directory Listing\command" /VE /D "Prin.bat \"%%1\"" /F

 

Save the file to the Desktop, then double-click the it.

Edited by TomGL2

Share this post


Link to post
Share on other sites

How to Print a Folder File List from Windows Explorer (Does not work on Vista)

 

 

I viewed this thread in its entrety for the first time, and it is apparent that problems with opening folders, among other difficulties, have resulted from the method given.  Following is a batch file that applies the tweak automatically, and as a bonus fixes the "folder open" problem for users that have experienced the issue.

 

MorbidButterfly, let me assure you that this is not a criticism of any kind.  You cannot be blamed for flaws in a tweak that you did not author.  Nor am I looking for any particular credit.  Heck, the meat of this is just four commands, the three "Echo"s and the first "Reg", which just isn't much to take credit for.  Mainly, I just don't want anyone else struggling to make this work, then ending up with problems.

 

Onward ...

 

Click Start, Run type Notepad MakePrin.bat and click OK, click Yes to create the file.  Copy & paste the following.

 

@Echo off

Echo.

Echo "Print Folder List", PCPitstop Forums

Echo Administrator's rights needed to install

Echo.

Pause

 

Rem Create Prin.bat in Windows folder, contains

Rem Dir %1 /O:GN > "%Temp%\Listing"

Rem Start /W Notepad /P "%Temp%\Listing"

Rem Del "%Temp%\Listing"

 

Echo Dir %%1 /O:GN ^> "%%Temp%%\Listing" > "%Windir%\Prin.bat"

Echo Start /W Notepad /P "%%Temp%%\Listing" >> "%Windir%\Prin.bat"

Echo Del "%%Temp%%\Listing" >> "%Windir%\Prin.bat"

 

Rem Install command in Registry

Reg Add "HKCR\Directory\shell\Print Directory Listing\command" /VE /D "Prin.bat \"%%1\"" /F

 

Rem Set (default) to "none", in case

Rem previous manual attempt nuked it

Reg Add "HKCR\Directory\shell" /VE /D none /F

 

Echo.

Echo Done. Right-click a folder and click

Echo Print Directory Listing to test

Echo.

Pause

 

Click File, Save As, select Desktop in the Save in list, click Save and close Notepad.

 

Double-click MakePrin.bat on the Desktop, and press a key to continue  There should be no errors unless you're logged on as a limited user ... log on as a user with administrator's rights.

 

[ For you batch file buffs, sorry, nothing exotic there ... ]

Share this post


Link to post
Share on other sites

An alternate approach. Do a simple command from biterscripting ( http://www.biterscripting.com ) or another scripting language. Some useful commands

 

List everything in folder, including hidden and other files that explorer won't show you

lf -n

 

List everything recursively

lf -rn

 

List all attributes (sizes, times, etc.)

lf

 

List names that match a pattern

lf -n "*.txt"

 

List all folders and subfolders (no flat files)

lf -rn "*" "C:\somefolder" ($ftype=="d")

 

List everything modified on or after May 1, 2009.

lf -rn "*" "C:\somefolder" ($fmtime > "20090501")

 

etc.

 

See the on line documentation for the lf/find command on their web site. You can put these and other commands in a script and execute in interactive, console, batch, from task scheduler, as part of a web server, etc.

 

 

Patrick

Share this post


Link to post
Share on other sites

Why bother risking damaging your registry ...

The batch file provided in my Feb 1 post eliminates the risk.

 

... when you can use a more powerful application instead

I use Directory Report

KarenWare.com's Directory Printer is good, too.

 

and DOS output is too basic

But sometimes it's exactly what's needed.

Share this post


Link to post
Share on other sites

Thanks to:

Gizmo

Ian Richards

Senior Editor, WindowsSecrets.com

 

How to Print a Folder File List from Windows Explorer (Does not work on Vista)

 

It's often useful to print the names of all the files in a folder, but this capability is not built into Windows by default.

 

Some third party file managers offer this function and there are some specialist utilities that will do the job as well.

 

But what most people don't realize is that you can set up Windows to do the job without having to use other utilities. In this article I'll show you how.

 

This technique makes use of the fact that good old DOS can print a folder file listing. All you do is use a DIR command and redirect the listing to your printer rather than your screen.

 

Don't panic! I'm not going to ask you to run DOS from the command windows. There is an easier way.

 

All you need do is create a batch file using Notepad or other plain text editor and then configure Windows to run the batch file from Windows Explorer right click context menu.

 

Microsoft has a knowledge base article [1] explaining exactly how to create and use the batch file and full instructions on integrating this into Windows Explorer.

 

Unfortunately, the KB article leaves out one step in the instructions, so I've reproduced a modified version of the KB article below:

 

To add the print directory feature to Windows Explorer, follow these steps:

a) Open Notepad and then copy and 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

 

Posted Image Save the file as Prin.bat in the Windows directory, and then close Notepad.

 

c) Start Windows Explorer, click Tools, and then click Folder Options.

 

d) Click the File Types tab, and then click File Folder. d1)Click Advanced (this step added by Gizmo)

 

e) Click Edit, and then click New.

 

f) In the Action box, type Print Directory Listing.

 

g) In Application used to perform action, click Prin.bat, and then click OK.

 

h) Click OK, click Apply, and then click OK.

 

Now Open Windows Explorer, right-click the folder that you would like to print a directory listing of, and then click Print Directory Listing.

 

That's it. The print directory feature has been permanently added to your copy of Windows

 

[1] http://support.micro...om/?kbid=272623

 

I use a tool to Print file list of a drive using Print Directory software

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...