How can I print a list of the contents of any folder?
Article contributed by Terry Farrell and Beth Melton
Sometimes you may want to print a list of the files you see in the File, Open dialog or a map of the files in Windows Explorer. Frustratingly, Microsoft didn't add this simple facility.
Using the Command Window
The basic technique is: open a command window, obtain the directory listing you want, then export it to a text file. Here's how:
- Go to your Start menu and choose the Run item
- In the Run prompt, type "cmd" and hit Enter
- Type "cd " and a space but do NOT hit Enter
- Now, in Windows Explorer (the yellow one, not Internet Explorer) or in My Computer, navigate to the folder you want.
- Drag that folder into the CMD window. Now hit Enter. Don't worry, the folder won't go anywhere: this is just an easy way of changing to the directory you want without having to type it!)
- Now type "Dir *.*" and hit Enter. This will list the content of the directory for you.
- At this point, you can adjust the output of the Dir command so that what you see listed is what you want. For example, the "/w" switch changes the columns around to make it easier to use the result later.
- Now we "pipe" the output to a text file. For example, type
"Dir *.doc /w | listing.txt" to list only the documents in the folder. Note the vertical bar '|' symbol. That's the "pipe" command that pipes the output of the first command to the input of the second command (create a text file named 'listing.txt'). - In Windows Explorer, refresh your display. You will find that a file named "listing.txt" has appeared in the directory.
- Open the file in Word and remove the columns you do not want. To do this:
- Set the font to Courier New to lay things out in columns
- Hold down your Alt key as you drag across a column. This selects a vertical block of text.
- Press "Del" to delete the column you have selected. Rinse and repeat...
This sounds involved, but it's actually a lot easier to do than it is to describe. Practice a couple of times so you can do it quickly whenever you want it.
If you have Outlook
If you have Microsoft Outlook, MS have given you a back door for printing any file list.
1. |
Open Outlook and make sure that the Outlook Bar is active (View, Outlook Bar) |
||||||||
2. |
Click on Other Shortcuts at the bottom of the Outlook Bar. By default, it will have icons for My Computer, My Documents and Favourites |
||||||||
3. |
Select My Documents. This will present you with a Details list of your My Documents folder. Using the View, Current View menu you can completely customise this view to show exactly what you want, adjust the default column widths until the printable display is perfect for your requirement. You can even sort the display into File Types. |
||||||||
4. |
Use File, Print to print it. |
||||||||
5. |
You can add shortcuts directly to any folder (on Local or Network drives) by dragging the item from the Folder List to the Outlook Bar. |
||||||||
6. |
You can also customize the view using the Field Chooser: |
||||||||
|
|||||||||
7. |
If you want to select just a particular type of file to list and print, use View, Current View and check By File Type. You can then expand the view for the file type required (and collapse all others), Highlight the expanded selections and choose File, Print, Only Selected Rows, |
See also: How to get the names of all the folders in the folder tree, starting from a specified folder.