Hack 26. Force Windows Explorer into True Usefulness
Here's a grab bag of ways to make better use of Explorer.
There are plenty of small ways you can hack Explorer to make your computing life more productivefor example, by hacking the right-click shortcut menu. Try out these hacks and see.
3.7.1. Add Shortcut Menu Items to Specific File Types
When you right-click a file in Explorer, you get a shortcut menu that includes a list of programs with which you can open the file. But the programs you want to open those files might not always be on the shortcut menu. It's easy to add new programs to that list. Let's say you want to add a shortcut menu item that allows .gif files to be opened with the freeware graphics viewer IrfanView [Hack #99] . From Windows Explorer, choose Tools Folder Options File Types. In the Registered File Types list, select the file type for which you want to add a new shortcut menu item. In our example, we'll choose a GIF file. After this hack, any time you click a file of this type, you'll get a new choice to open the file with.
Once you've chosen your file type, choose Advanced New. Youll see the New Action dialog box shown in Figure 3-12.
Figure 3-12. Adding a new program to the shortcut menu
In the New Action box, type the text you want to appear on the shortcut menufor example, Open with IrfanView. In the "Application used to perform action" box, enter the executable program you want to open the file with, including the full path. Surround it by quotation marks. Then leave a space and type %1. The %1 is a placeholder; it will be used as a substitute for the name of the file on which you right-click. In our instance, the entire string looks like this:
"C:\Program Files\i_view32.exe" "%1"
Click OK. The change will take place immediately, and the new command will appear on the shortcut menu for the specified file type.
3.7.2. Add Global Shortcut Menu Items to All File Types
The previous section of this hack showed how to add shortcut menu items on a file-type-by-file-type basis. In other words, it will be available only on the shortcut menu for the one specific file type you specify. But you can also add that shortcut menu item to every type of file by using a Registry hack. This is useful when you have a program that can open a wide variety of file types, and you don't want to have to add a shortcut menu item for every one of those file types. I use the IrfanView graphics viewer for many different types of graphics, so I want it to show up on all those types. Although it will also show up on file types I won't use it with, such as Word files, it's still worth putting it on the menu globally because of all the time I save by not having to add shortcut menu items over and over again for each file type.
Run the Registry Editor [Hack #83] and go to HKEY_CLASSES_ROOT\*. Create a new subkey called Shell if it doesn't yet exist. The Shell subkey can control parts of the user interface. Create a new subkey under Shell and name it what your new command will befor example, OpenWithIrfanView. For the default value of the new subkey, type in the text you want to appear on the shortcut menufor example, Open with IrfanView. Create a new subkey named Command under the subkey you just created. This subkey will contain the command string you want to be executed to open the file. For the default value of the Command subkey, enter the command string you want to be executed when the shortcut menu item is chosenfor example:
"C:\Program Files\i_view32.exe" "%1"
Exit the Registry. The new shortcut menu item should be available immediately, though you might need to reboot for it to take effect.
3.7.3. Edit File Association Actions
You can use Windows Explorer to change how XP handles file types; for example, you can choose the default action when the file type is double-clicked, choose the application associated with the file type, choose the icon for the file type, and choose whether the extension should be displayed or hidden in Windows Explorer. To perform most of these actions, choose Tools Folder Options File Types, choose the file type for which you want to customize an action, and then click Advanced. You'll see the screen shown in Figure 3-13.
Figure 3-13. Editing file associations and their actions
From the Edit File Type dialog box, you can change the icon, edit the action to be taken on the file, and choose whether to display the file type in Windows Explorer. The dialog box is fairly self-explanatory. For example, click Change Icon to change the icon; to edit any action, highlight it and click Edit. If you want to change the application associated with the file, choose Tools Folder Options File Types, choose the file type whose association you want to change, click Change, and then choose the application you want to be associated with the file type in the same way as shown in Figure 3-12.
3.7.4. Remove Context Menu Items from Explorer
Explorer's menus can get messy at times. But you can use a Registry hack to clean it up a bit by removing two items from the Tools menu: Map Network Drive and Disconnect Network Drive. Run the Registry Editor and go to:
Create the DWORD entry NoNetConnectDisconnect. Give it a value of 1. Exit the Registry. You might have to reboot for the setting to take effect and the items to disappear from the menu. To place the items back on the Explorer menu, edit the value to 0, or delete the entry.
3.7.5. Organize the All Programs Menu with Explorer
If you're using the default Windows XP Start Menu view and you're not happy with the way your All Programs menu is organized, you can use Windows Explorer to modify it. The All Programs menu is nothing more than a collection of shortcuts found in two folders: the C:\Documents and Settings\<Your Account>\Start Menu folder (where <Your Account> is your account name), and the C:\Documents and Settings\All Users\Start Menu folder. Items you want to appear at the very top of the All Programs menu should be put in one of the \Start Menu folders (depending upon whether you want the item to appear on only your All Programs menu, or on the All Programs menu of all users). Items you want to appear on the lower part of the All Programs menu should be put into the \Start Menu\Programs folder, again, depending on whether you want the item to appear on only your All Programs menu, or on the All Programs menu of all users.