Windows XP Hacks Free Open Book

Windows XP Hacks

Previous Section Next Section

Hack 21 Generating Folder and File Listingsfor Printing or Editing

figs/expert.giffigs/hack21.gif

Longtime PC users and former Mac users alike are often shocked when they realize that there's no easy, built-in option to print a list of files in a folder. This hack creates a context-menu right-click option to create such a list, which you can then edit, copy, paste, and—most usefully—print.

How many times have you been browsing through directories in Windows Explorer and wished you could generate a text file or printout listing the files and folders? It seems like such a simple request that it's amazing the option isn't available. You don't believe me? Right-click on a folder and see for yourself if there is an option to list or print the structure. There isn't, but there is a workaround that doesn't require any third-party software. Here's how to create a context menu item [Hack #29] that, when clicked, generates a printable (and editable) text-file listing of the selected directory.

To create the entry in the context menu it's necessary to first create a batch file. A batch file is a text file that contains a sequence of commands for a computer operating system and uses the .bat extension. The format for the .bat file is:

dir /a /-p /o:gen >filelisting.txt

The name of the .txt file can be whatever you like. In this example, I've used filelisting.txt, but it could just as easily be filelist, listoffiles, namedfiles, or even Wally if you enjoy the bizarre in your filenaming schemes. Once you've decided on the filename, create the file in Notepad, as shown in Figure 3-1.

Figure 3-1. Creating a batch file in Notepad
figs/xph_0301.gif

Save the file in your WINDOWS folder as shown in Figure 3-2, making sure to use the .bat extension and not the default .txt extension. It's important to set "Save as type" to All Files and "Encoding:" to ANSI.

Figure 3-2. Saving file listing.bat
figs/xph_0302.gif

Now that we have the .bat file created, the next step is to make it functional and easily accessible by integrating it into the context menu that opens when a right click is executed. Open Windows Explorer and choose Tools Folder Options File Types tab Folder Advanced New, to open the New Action box shown in Figure 3-3.

Figure 3-3. Creating a new action for the context menus
figs/xph_0303.gif

In the Action box, type the name that you want to appear in the context menu. Once again, you have wide latitude in choices; something like Create File Listing will probably be most useful, but you can name yours something more confusing if you like. Browse to the location of the .bat file you created, and select it in the box labeled "Application used to perform action." Click OK, and you'll see that Create File Listing (or whatever you chose as an action name) has been added as one of the Actions in the Edit File Type window, as shown in Figure 3-4. Do the standard Windows dance of clicking OK again to close all the open windows.

Figure 3-4. The revised Edit File Type box with your new action
figs/xph_0304.gif

That's it! Congratulations. You've created a new item on the context menu that's ready to go to work. So, now that's it there, what can you do with it?

Open up Windows Explorer. Navigate to whatever folder you want to use as the basis for the file list, and right-click to open the context menu. Click on the Create File Listing item (see Figure 3-5), and the list will be generated and displayed at the bottom of the open Notepad window as filelisting.txt. Figure 3-6 shows the file listing generated from the Sample Music folder shown in Figure 3-5. Since it is a text file, it can be fully edited, copied, pasted, printed, and so on for any purpose.

Figure 3-5. Your new context-menu action: Create File Listing
figs/xph_0305.gif
Figure 3-6. The generated file listing, all ready for editing and printing
figs/xph_0306.gif

If for any reason you want to remove the Create File Listing entry from the context menu, you must edit the Registry [Hack #68]. Navigate to HKEY_CLASSES_ROOT\Folder\shell\Create_File_Listing and delete the Create_File_Listing key in the left pane. Close regedit and reboot to complete removal.

3.2.1 Alternative Method for Users of Outlook XP

If you happen to be a user of Outlook XP, there is another method available for printing directory listings that requires no system modifications. Using the Outlook Bar, you can generate a nicely formatted listing with a few mouse clicks:

  1. Open Microsoft Outlook.

  2. Choose View Outlook Bar Other Shortcuts.

  3. The three default selections listed are My Computer, My Documents, and Favorites. Select one and navigate the tree until the directory is displayed in the right pane.

  4. When the display matches what you'd like to print, click the printer icon on the Outlook toolbar.

—Jim Foley

    Previous Section Next Section
    Index: [SYMBOL][A][B][C][D][E][F][G][H][I][J][L][M][N][O][P][Q][R][S][T][U][V][W][X][Z]


         Main Menu
    Main Page
    Table of content
    Copyright
    Credits
    Preface
    Chapter 1. Startup and Shutdown
    Chapter 2. The User Interface
    Chapter 3. Windows Explorer
    3.1 Hacks #21-32
    Hack 21 Generating Folder and File Listingsfor Printing or Editing
    Hack 22 Control Windows Explorer with Command-Line Shortcuts
    Hack 23 Empower Windows Explorer with PowerDesk
    Hack 24 Better File Rename
    Hack 25 Find Files Faster by Mastering the Indexing Service's Query Language
    Hack 26 Hiding Folders and Files with the Encrypting File System
    Hack 27 Forcing Windows Explorer Into True Usefulness
    Hack 28 Customize Folder Icons and Balloon Text
    Hack 29 A Power User's Hidden Weapon: Improve the Context Menu
    Hack 30 Take Your Work on the Go with Offline Files and the Briefcase
    Hack 31 Get More Hard Disk Space by Using NTFS Compression
    Hack 32 Put a Command-Line Prompt on Your Desktop
    Chapter 4. The Web
    Chapter 5. Networking
    Chapter 6. Email
    Chapter 7. The Registry
    Chapter 8. Basic Utilities
    Chapter 9. Applications
    Chapter 10. Graphics and Multimedia
    Chapter 11. System Performance
    Chapter 12. Hardware
    Colophon
    Index


    More Books
    PHP Hacks
    Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
    The Koran (Holy Qur'an)
    Macromedia Flash 8 Bible
    Search Engine Optimization for Dummies
    YouTube Traffic
    PHP 5 for Dummies
    Harry Potter and The Chamber of Secrets
    Harry Potter and the Sorcerer's Stone
    The Pilgrim's Progress
    Wireless Hacks
    Flash Hacks. 100 Industrial-Strength Tips & Tools
    PayPal Hacks. 100 Industrial-Strength Tips and Tools
    Amazon Hacks
    Pdf Hacks
    The Da Vinci Code
    Google Hacks
    The Holy Bible
    Windows XP For Dummies
    Harry Potter and the Half-Blood Prince
    Seo Book
    Upgrading and Repairing Networks
    Macromedia Dreamweaver 8 UNLEASHED
    Windows XP Annoyances
    Windows XP Hacks
    Microsoft Windows XP Power Toolkit
    Teach Yourself MS Office In 24Hours
    iPod & iTunes Missing Manual
    PC Hacks 100 Industrial-Strength Tips and Tools
    PC Overclocking, Optimization, and Tuning - 2th Edition
    PC Hardware In A Nutshell 3rd Edition
    PC Hardware in a Nutshell, 2nd Edition
    Upgrading and Repairing PCs
    Google for Dummies
    MySQL Cookbook
    Teach Yourself Macromedia Flash 8 In 24 Hours
    PHP CookBook
    Sams Teach Yourself JavaScript in 24 Hours
    PHP5 Manual
    Free Games Paper Airplanes
    500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele