I have been looking for a way to print or export the contents of a windows directory besides doing ALT-printScreen. Thanks to my new book, Windows XP Annoyances, I have found a way:
- Make sure you back up your registry in case you screw something up.
- Open regedit
- navigate to HKEY_CLASSES_ROOT\Folder\shell
- Select New from the Edit menu, select Key and then type Print Contents (or whatever you want) for the name of the new key (it looks like you are creating a new folder)
- highlight the new key / folder and do edit -> new again. this time create a key called command .
- Double Click on the right pane where it says Default and enter the value cmd.exe /c dir "%1" > PRN
- Do the exact same thing to create a key called Save Contents and then another key in that called command. For the value of command key type : cmd.exe /c dir %1 > "Folder Listing.txt"
- After you close the regedit program, and right click on any directory, you will see options to print or save the directory listing!
All from page 145-146 of the book.
It is possible to simply type the commands above into the command line, but that means navigating manually to the folder and retyping the commands every time.
Microsoft published a different solution: but the one from Annoyances seems a lot easier.
There is also shareware that does this as well. The shareware, DirPrinter, has subdirectory functionality and can export to a variety of formats.
A while ago, I found a solution that uses visual basic to export the folder contents in a recursive fashion so that you get the current directory and then all the files and subdirectories under it.
6:49:40 PM
|