Opening a Document with an Unassociated Application
You
can see the process that Windows Vista goes through when you
double-click a document:
1. | Look up the document’s extension in HKEY_CLASSES_ROOT.
|
2. | Examine the Default value to get the name of the file type subkey.
|
3. | Look up the file type subkey in HKEY_CLASSES_ROOT.
|
4. | Get the Default value in the shell\open\command subkey to get the command line for the associated application.
|
5. | Run the application and open the document.
|
What do you do if you want to bypass this process and have Windows Vista open a document in an unassociated
application? (That is, an application other than the one with which the
document is associated.) For example, what if you want to open a text
file in WordPad?
One possibility would be to launch the
unassociated application and open the document from there. To do so,
you’d run the File, Open command (or whatever) and, in the Open dialog
box, select All Files in the Files of Type list.
That will work, but it defeats the convenience
of being able to launch a file directly from Windows Explorer. Here’s
how to work around this:
1. | In Windows Explorer, select the document with which you want to work.
|
2. | Select File, Open With. (Alternatively, right-click the document, and then click Open With in the shortcut menu.)
|
3. | The next step depends on the file you’re working with:
For most files, Windows Vista goes directly to the Open With dialog box. In this case, skip to step 4. For a system file, Windows asks whether you’re sure that you want to open the file. In this case, click Open With. For
some file types, Windows Vista displays a submenu of suggested
programs. In this case, if you see the alternative program you want,
select it. Otherwise, select Choose Default Program.
|
4. | Select
the unassociated application in which you want to open the document.
(If the application you want to use isn’t listed, click Browse and then
select the program’s executable file from the dialog box that appears.)
|
5. | To
prevent Windows Vista from changing the file type to the unassociated
application, make sure that the Always Use the Selected Program to Open
this Kind of File check box is deactivated.
|
6. | Click OK to open the document in the selected application.
|
Note that Windows Vista remembers the
unassociated applications that you choose in the Open With dialog box.
When you next select the Open With command for the file type, Windows
Vista displays a menu that includes both the associated program and the
unassociated program you chose earlier.
How the Open with Feature Works
Before you learn about the more advanced Open
With customizations, you need to know how Windows Vista compiles the
list of applications that appear on the Open With list:
Windows Vista checks HKEY_CLASSES_ROOT\.ext (where .ext is the extension that defines the file type). If it finds an OpenWith subkey, the applications listed under that subkey are added to the Open With menu and they appear in the Open With dialog box in the Recommended Programs section.
Windows Vista checks HKEY_CLASSES_ROOT\.ext to see whether the file type has a PerceivedType setting. If so, it means the file type also has an associated perceived type.
This is a broader type that groups related file types into a single
category. For example, the Image perceived type includes files of type
BMP, GIF, and JPEG, whereas the Text perceived type includes the files
of type TXT, HTM, and XML.x Windows Vista then checks the following:
HKEY_CLASSES_ROOT\SystemFileAssociations\PerceivedType\OpenWithList
Here, PerceivedType is value of the file type’s PerceivedType setting. The application keys listed under the OpenWithList key are added to the file type’s Open With menu and dialog box.
Windows Vista checks HKEY_CLASSES_ROOT\Applications, which contains subkeys named after application executable files. If an application subkey has a \shell\open\command subkey, and if that subkey’s Default value is set to the path name of the application’s executable file, the application is added to the Open With dialog box.
Windows Vista checks the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ÂFileExts\.ext\
OpenWithList
Here, ext
is the file type’s extension. This key contains settings for each
application that the current user has used to open the file type via
Open With. These settings are named a, b, c, and so on, and there’s an MRUList
setting that lists these letters in the order in which the applications
have been used. These applications are added to the file type’s Open
With menu.
Removing an Application from a File Type’s Open with Menu
When you use the Open With dialog box to choose
an alternative application to open a particular file type, that
application appears on the file type’s Open With menu (that is, the menu
that appears when you select the File, Open With command). To remove
the application from this menu, open the following Registry key (where ext is the file type’s extension):
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ÂFileExts\.ext\
OpenWithList
Delete the setting for the application you want removed from the menu. Also, edit the MRUList
setting to remove the letter of the application you just deleted. For
example, if the application setting you deleted was named b, delete the
letter b from the MRUList setting.
Removing a Program from the Open with List
Rather
than customizing only a single file type’s Open With menu, you might
need to customize the Open With dialog box for all file types. To
prevent a program from appearing in the Open With list, open the
Registry Editor and navigate to the following key:
HKEY_CLASSES_ROOT/Applications
Here you’ll find a number of subkeys, each of
which represents an application installed on your system. The names of
these subkeys are the names of each application’s executable file (such
as notepad.exe for Notepad). To prevent Windows Vista from
displaying an application in the Open With list, highlight the
application’s subkey, and create a new string value named NoOpenWith. (You don’t have to supply a value for this setting.) To restore the application to the Open With list, delete the NoOpenWith setting.
Note
The NoOpenWith setting works only for applications that are not the default for opening a particular file type. For example, if you add NoOpenWith to the notepad.exe
subkey, Notepad will still appear in the Open With list for text
documents, but it won’t appear for other file types, such as HTML files.
Adding a Program to the Open with List
You can also add an application to the Open With dialog box for all file types. Again, you head for the following Registry key:
HKEY_CLASSES_ROOT/Applications
Display the subkey named after the application’s executable file. (If the subkey doesn’t exist, create it.) Now add the \shell\open\command subkey and set the Default value to the pathname of the application’s executable file.
Disabling the Open with Check Box
The Open With dialog box enables you to change
the application associated with a file type’s Open action by activating
the Always Use the Selected Program to Open This Kind of File check box.
If you share your computer with other people, you might not want them
changing this association, either accidentally or purposefully. In that
case, you can disable the check box by adjusting the following Registry
key:
HKEY_CLASSES_ROOT\Unknown\shell\opendlg\command
The Default value of this key is the following:
%SystemRoot%\system32\rundll32.exe %SystemRoot%\system32\shell32.dll,ÂOpenAs_RunDLL %1
To disable the check box in the Open With dialog box, append %2 to the end of the Default value:
%SystemRoot%\system32\rundll32.exe %SystemRoot%\system32\shell32.dll,ÂOpenAs_RunDLL %1 %2