Every operating system needs a mechanism to associate documents with the applications that created them. When you double-click a Microsoft Word document icon, for example, Word launches and opens the document. In Windows, every document comes complete with a normally invisible filename extension (or just file extension) ” a period followed by a suffix that's usually three letters long. Here are some common examples:
NOTE For an exhaustive list of every file extension on the planet, visit http://www.whatis.com; click the link for "Every File Format in the World." Behind the scenes, Windows maintains a massive table that lists every extension and the program that "owns" it. To see this list, choose Tools Folder Options from the menu bar of any folder window. When the Folder Options box appears, simply click the File Types tab (Figure 6-8). Figure 6-8. Each software program you install must register the file types it uses. The link between the file type and the program is called an association. This dialog box displays the icon for each file type and an explanation of the selected listing. In this example, the box tells you that sound files with the suffix .aiff open in Windows Media Player when double-clicked.6.9.1 Displaying Filename ExtensionsIt's possible to live a long and happy life without knowing much about these extensions. Indeed, because file extensions don't feel very user -friendly, Microsoft designed Windows to hide the suffixes on most icons (see Figure 6-9). If you're new to Windows, and haven't poked around inside the folders on your hard drive much, you may never even have seen them. Figure 6-9. Windows lets you see the filename extensions only when it doesn't recognize them. Right: If Windows recognizes the filename extension on an icon, it hides the extension (look closely at the filenames). Left: You can ask Windows to display all extensions, all the time.Some people appreciate the way Windows hides the extensions, because the screen becomes less cluttered and less technical-looking. Others make a good argument for the Windows 3.1 days, when every icon appeared with its suffix. For example, in a single Desktop window, suppose one day you discover that three icons all seem to have exactly the same name : PieThrower. Only by making filename extensions appear would you discover the answer to the mystery: that is, one of them might be called PieThrower.ini, another is an Internet-based software updater called PieThrower.upd, and the third is the actual PieThrower program, PieThrower.exe. One way to make sense of such situations is simply to look at the window in Details view (right-click in the window and choose View Details from the shortcut menu). But that's too easy. To fully breathe in Windows technology, you can instruct Windows to reveal the file suffixes on all icons. To do so, choose Tools Folder Options from any folder window's menu bar. In the Folder Options dialog box, click the View tab. Turn off "Hide extensions for known file types," and then click OK. Now the filename extensions for all icons appear. NOTE Even if you prefer to hide most file extensions, you may still want one particular type of document to appear on the screen with file extensions. For example, when working on a Web site, you may want to check whether the suffixes of your Web page documents are .htm or .html. In these situations, choose Tools Folder Options in any Desktop window. Click the File Types tab (see Figure 6-8). Scroll down to the file extension you want to make visible, click it, click the Advanced button, and ”in the Edit File Type dialog box ”turn on "Always show extension." Click OK, and then click the Close button. 6.9.2 Hooking up a File Extension to a Different ProgramWindows XP comes with several programs (Notepad and WordPad, for example) that can open text files with the extension .txt. And Windows also comes with several programs (Paint, Imaging, Internet Explorer) that can open JPEG picture files with the extension .jpg . So how does it decide which program to open when you double-click a .txt or .jpg file? Windows comes with its own extension-to-application pairing list, as depicted in Figure 6-8. But at any time, you can reassign a particular file type (file extension) to a different application. Having just bought Photoshop, for example, you might want it to open up your JPEG files, rather than Windows Picture and Fax Viewer. The long way to perform this reassignment surgery is to use the File Types tab of the Folder Options dialog box shown in Figure 6-8. Click the file type you want to change, click the Change button, and then proceed as shown in Figure 6-10. Figure 6-10. Left: Windows is prepared to show you a list of every program that can open the mystery file. Scroll through the list of installed programs to select the one you want. By turning on the checkbox at the bottom of the dialog box, you create a file association that will handle similar files (those with the same file extension) in the future. Right: A shortcut to the dialog box shown at left is the Open With Choose Program shortcut menu.Here's the short way: Right-click the icon of the file that needs a new parent program. In the shortcut menu, you'll see a command called Open With. As shown at right in Figure 6-10, it may offer a submenu that lists the programs capable of opening the file. If the submenu isn't offered ”or if you bypass these proposals and select Choose Program from the submenu ”Windows presents the Open With dialog box shown at left in Figure 6-10. Just find, and double-click, the name of the program you now want to open this kind of file. As you do so, be sure to check the status of the checkbox below the list, which says, "Always use the selected program to open this kind of file." If that checkbox is on, then all files of this type (.jpg, for example) will open in the newly selected application from now on. If the checkbox is off, then the new application will open only this .jpg file ”just this once. NOTE This technique is an effective cure if you've made a file association by mistake, or when a newly installed program performs the dreaded Windows Power Grab, claiming a particular file type for itself without asking you. 6.9.3 Creating Your Own File AssociationsEvery now and then, you might try to open a mystery icon ”one whose extension is missing, or whose extension Windows doesn't recognize. In that case, the dialog box shown in Figure 6-11 will appear. Maybe you've tried to double-click a document sent to you by a Macintosh fan (many Macintosh files lack file extensions), or maybe you're opening a document belonging to an old DOS program that doesn't know about the Windows file-association feature. Figure 6-11. Left: Sometimes Windows doesn't know what to do with an icon you've just double-clicked. Right: Use this window to select a program for opening the mystery file. It's sometimes useful to associate a particular document type with a program that didn't create it, by the way. For example, if you double-click a text file, and the Open With dialog box appears, you might decide that you want such documents to open automatically into WordPad.In any case, Windows offers you two different buttons :
6.9.4 Fun with File AssociationsThe File Types tab on the Folder Options dialog box shown in Figure 6-8 provides an excellent display of the icons, file extensions, and descriptions of your various file types. As noted earlier, it also offers the New button, which lets you tell Windows about new file types, and the Change button, which lets you reassign an existing file type to a different program. At the bottom of the box, though, is an Advanced button. When you click it, the dialog box shown at top left in Figure 6-12 appears. This box contains a few tweaky settings that could come in handy someday. For example:
Figure 6-12. Top left: The Advanced box lets you make even more decisions about each file type on your PC, including its auto-downloading behavior, double-click behavior, and (at top right) even its icon. Bottom left: In the top box, type the name for the new shortcut-menu command you want to create. Then click Browse to choose the program file for Photoshop itself. (Alternatively, you could type the path to the Photoshop program into the "Application used to perform action" text box.) Either way, add a space and then %1 to the end of the pathname shown in the lower box ”a reference to the file being opened. Bottom right: A doctored shortcut menu at work.NOTE Placing an ampersand (&) symbol into the shortcut-menu command, as shown at lower left in Figure 6-12, creates an underlined shortcut key, as shown at lower right. |