Working with Existing File Types
In this section, you’ll learn how to work with Windows XP’s existing file types. I’ll show you how to change the file type description, modify the file type’s actions, associate an extension with another file type, and disassociate a file type and an extension.
Figure 3.4 The File Types tab offers a front-end for working with Windows XP’s registered file types.
Editing a File Type
To make changes to an existing file type, follow these steps:
Open the Folder Options dialog box and display the File Types tab, as described earlier.
Use the Registered File Types list to select the file type you want to work with.
Click Advanced. The Edit File Type dialog box appears. Figure 3.5 shows the Edit File Type dialog box for the Text Document type.
The text box at the top holds the description of the file type, which you can edit. This description appears in the Registered File Types list and in the New menu (right-click a folder and then click New).
You can also work with the following controls:
-
Despite the name of this check box, Internet Explorer displays the File Download dialog box before you download the file.
-
For many file types, the File Download dialog box includes a check box named Always Ask Before Opening This Type of File. Deactivating this check box is the same thing as deactivating the Confirm Open After Download check box.
Click OK to return to the File Types tab.
Click Close.
Change Icon |
Click this button to display the Change Icon dialog box. Use this dialog box to select a new icon for the file type. |
Actions |
This list shows the actions defined for the file type. I discuss file type actions in more detail in the next section. |
Confirm Open After Download |
When this check box is activated and you attempt to download a file from the World Wide Web, Internet Explorer displays the File Download dialog box that asks whether you want to save or open the downloaded file (see Figure 3.6). Otherwise, Internet Explorer just opens the file using its associated application. Here are two points to bear in mind: |
Always Show Extension |
If you activate this check box, Windows XP shows this file type's extension even if you hide extensions globally. |
Browse in Same Window |
When this check box is activated, the file type opens within Internet Explorer instead of its associated application. This applies only to Microsoft Office file types that are capable of being displayed within Internet Explorer. |
Figure 3.5 Use the Edit File Type dialog box to make changes to an existing file type.
Figure 3.6 If the Confirm Open After Download check box is activated, Internet Explorer displays this dialog box.
Working with File Type Actions
In the Edit File Type dialog box, the Actions list displays the defined actions for the file type. You usually see two types of actions:
An action shown in boldface represents the default action for the file type. This is the action that’s performed when you double-click one of these files (or highlight a file and press Enter). This action also appears in bold on the file type’s shortcut menu (the menu that appears when you right-click a file of that type).
All other actions are listed on the shortcut menu for the file type.
The buttons beside the Actions list enable you to work with the file type’s actions:
New |
Click this button to create a new action for the file type. See "Creating a New File Type Action," later in this chapter. |
Edit |
Click this button to make changes to the selected action. See "Editing a File Type Action," later in this chapter. |
Remove |
Click this button to delete the selected action. |
Set Default |
Click this button to make the selected action the default for this file type. |
Associating an Extension with a Different Application
There are many reasons you might want to override Windows XP’s default associations and use a different program to open an extension. For example, you might prefer to open text files in WordPad instead of Notepad. Similarly, you might want to open HTML files in Notepad or some other text editor rather than Internet Explorer.
In these cases, you need to associate the extension with the application you want to use instead of the Windows default association. Windows XP gives you two ways to go about this:
The Open With dialog box |
With this method, right-click any file that uses the extension and then click Open With. (If you’ve used the Open With dialog box on this extension before, click the Choose Program command from the menu that appears.) In the Open With dialog box, select the program you want to use, activate the Always Use This Program to Open These Files check box, and click OK. |
The File Types tab |
With this method, you use the File Types tab to edit the Open action of the file type. See the next section to learn how to edit a file type action. |
Editing a File Type Action
Follow these steps to make changes to a file type action:
-
In the File Types tab, select the file type you want to work with.
-
Click the Advanced button. The Edit File Type dialog box appears.
-
In the Actions list, select the action you want to change, and then click Edit. The Editing Action for Type: Type dialog box appears (where Type is the file type you're working with).
-
(Optional) Use the Action text box to change the name of the action.
-
In the Application Used to Perform Action text box, type the full pathname of the application you want to use for the action. Here are some notes to bear in mind:
-
If the pathname of the executable file contains a space, be sure to enclose the path in quotation marks, like so:
-
If you'll be using documents that have spaces in their filenames, add the %1 parameter after the pathname:
-
If you're changing the Print action, be sure to include the /P switch after the application's pathname, like this:
"C:\Program Files\My Program\program.exe"
"C:\Program Files\My Program\program.exe" "%1"
The %1 part tells the application to load the specified file (such as a filename you click), and the quotation marks ensure that no problems occur with multiple-word filenames.
"C:\Program Files\My Program\program.exe" /P
Creating a New File Type Action
Instead of replacing an action’s underlying application with a different application, you might prefer to create new actions. In our HTML file example, you could keep the default Open action as it is and create a new action—called, for example, Open for Editing—that uses Notepad (or whatever) to open an HTML file. When you highlight an HTML file and pull down the File menu, or right-click an HTML file, the menus that appear will show both commands: Open (for Internet Explorer) and Open for Editing (for Notepad).
To create a new action for an existing file type, follow these steps:
In the File Types tab, select the file type you want to work with.
Click the Advanced button. The Edit File Type dialog box appears.
Click New to display the New Action dialog box.
Use the Action text box to enter a name for the action.
Use the Application Used to Perform Action text box to enter the full pathname of the application you want to use for the new action. (Follow the guidelines that I outlined in the previous section.)
Click OK.
If you want the new action to be the default, select it and click Set Default.
Click OK to return to the File Types tab.
Click Close.
Example: Opening the Command Prompt in the Current Folder
When you’re working in Windows Explorer, you might find occasionally that you need to do some work at the command prompt. For example, the current folder might contain multiple files that need to be renamed—a task that’s most easily done within a command-line session. Selecting Start, All Programs, Accessories, Command Prompt starts the session in the %USERPROFILE% folder, so you have to use one or more CD commands to get to the folder you want to work in.
An easier way would be to create a new action for the Folder file type that launches the command prompt and automatically displays the current Windows Explorer folder. To do this, follow these steps:
Select Folder in the File Types tab.
Click Advanced to display the Edit File Type dialog box.
Click New to display the New Action dialog box.
Type Open &With Command Prompt in the Action text box (note that the letter W is the accelerator key).
Figure 3.7 shows a completed dialog box. Click OK when you’re done. Windows XP adds your new action to the Folder type’s Actions list.
cmd.exe /k cd "%L"
Figure 3.7 Use the New Action dialog box to define a new action for the file type.
In Figure 3.8, I right-clicked a folder. Notice how the new action appears in the shortcut menu. The command prompt window below is what appears if you click the Open With Command Prompt command.
Figure 3.8 The new action appears in the file type’s shortcut menu.
Disassociating an Application and an Extension
One of the most annoying things a newly installed program can do is change your existing file type associations. Some programs are courteous enough to ask you whether they can change some associations. However, many other programs make the changes without permission. In these cases, you often want to undo the damage by disassociating the new application from the affected extensions. You have two ways to proceed:
If you want to revert the association back to its original application, use the procedure I outlined earlier in the "Associating an Extension with a Different Application" section.
If you prefer to have no associated application at all, first display the File Types tab. Then select the file type or extension and click Advanced. In the Actions list, select Open and then click Remove.