Associating File Types with Multiple Applications

This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.

April 2001

by Gregory Shultz

Operating Systems: Windows 98/2000

As you know, Windows' file type association feature allows you to launch an application and load a data file at the same time simply by double-clicking on the data file. However, what if you have certain file types that you work with in more than one application? In a business environment this is pretty typical. Since a file type can be associated with only one application, this means that if you want to work with a data file in the other application, you must launch the application and then manually open the data file.

For example, you may work with BMP files in both Paint and Paint Shop Pro. As you know, BMP files are, by default, associated with Paint. Therefore, when you double-click on a BMP file, Paint automatically launches and loads the file. However, once you install Paint Shop Pro, you can choose to associate BMP files with it rather than Paint. However, if you go that route, it would mean that when you want to work with BMP files in Paint, you would first have to launch Paint and then use the File | Open command to load the BMP file into Paint. These extra steps could be considered a waste of time and energy.

Wouldn't it be nice if you could double-click on a data file and choose in which application to load it? Unfortunately, that's not possible. However, we've found the next best thing--a way to expand file type associations to more than one application. To perform this trick, you simply add a command to the file type's shortcut menu that opens a file of that type in the other application.

In this article, we'll show you how you can add such a command to any file type's shortcut menu. As we do, we'll work through a practical example.

Accessing the file type

Adding a command to a file type's shortcut menu is actually very easy. To do so, open Windows Explorer, pull down the View menu in Windows 98 or the Tools menu in Windows 2000, and select the Folder Options command. When the Folder Options dialog box appears, click on the File Types tab. Now, scroll through the Registered File Types list box and select the file type you want to modify. For example, if you want to be able to easily load BMP files in either Paint or Paint Shop Pro, you need to alter the BMP file's shortcut menu. To do so, you scroll through the Registered File Types list box and select the Bitmap Image file type, as shown in Figure A.

Figure A: Locate the file type you want to associate to an
additional application.
[ Figure A ]

Adding the command

Once you access the file type, you can easily add the command to the shortcut menu. To do so, click the Edit button in Windows 98 or the Advanced button in Windows 2000. When the Edit File Type dialog box appears, as shown in Figure B, click the New button.

Figure B: Once you see the Edit File Type dialog box, click the
New button.
[ Figure B ]

You'll now see the New Action dialog box. When you do, you'll give the command a name in the Action text box and then in the Application Used To Perform Action text box, you'll type the command line that will launch the application and load the data file. Basically, this command line consists of a path to the application's executable file followed by the variable parameter, %1, which will contain the name of the data file you want to open in the application. To see how to configure this, let's continue with our example.

To begin, type Open in Paint Shop Pro in the Action text box. Then, click the Browse button. When the Open With dialog box appears, you'll the locate Paint Shop Pro's executable file and select it.

When you click Open, the path to the application's executable file is added to the Application Used To Perform Action text box. At this point, you need to add the variable parameter to the command line, as shown in Figure C.

Figure C: Add the variable parameter to the end of the
command line.
[ Figure C ]

As you can see, both the command to launch the application and the variable parameter are enclosed in double quotes. The command line is enclosed because the path to the executable file contains spaces and the quotes ensure that the command is interpreted by the operating system as a single entity. The parameter is enclosed in double quotes so that if the path to the BMP file contains spaces, it's also recognized as a single entity.

Now, click OK to close the New Action dialog box. When you do, you'll see your new command in the Actions list box of the Edit File Type dialog box, as shown in Figure D.

Figure D: Your new command appears in the Actions list box.
[ Figure D ]

To save your changes, click OK to close the Edit File Type dialog box. Then, click the Close button to close the Folder Options dialog box.

Using your new command

Once you've added the new command to the shortcut menu, using it is a snap. For example, when you want to work with a BMP file in Paint, you can just double-click on the file. When you want to work with a BMP file in Paint Shop Pro, you just right-click on the file and select the Open In Paint Shop Pro command from the shortcut menu, as shown in Figure E.

Figure E: Now loading BMP files into Paint Shop Pro is just a
click away.
[ Figure E ]

Work without worry

If you work with certain file types in more than one application, you know what a pain it is to have to launch the application and then manually open the data file. In this article, we've shown you how to expand file type associations to more than one application by adding commands to a file type's shortcut menu.

Copyright © 2001 Element K Content LLC. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of Element K Content LLC is prohibited. Element K is a service mark of Element K LLC.