Techguy
December 2, 2000, 03:59 pm
Troubleshooting Windows file associations
Sep 28, 2000
Talainia Posey
Have you ever been extension-jacked? It's happened to many of us. You have a favorite program that you use almost every day. One day, you install an unrelated program, and it takes over the file extensions that were registered by the other program. Now, when you double-click a file that was created by your other program, the new program launches and tries (usually unsuccessfully) to open the file. Fortunately, there are some ways to fight back when this situation happens to you. This article explains some techniques that you can use in a Windows 98 environment to restore file associations that have been taken over by a rogue program.What are file extensions?
File extensions are the three characters preceded by a period at the end of a file name, such as .txt, .doc, or .exe. Windows associates certain actions or programs with these extensions. For example, if you double-click an .exe file, Windows will assume that it's an executable program and attempt to load it, but if you double-click a .txt file, Windows will display the file in Notepad.
Before we begin
Before I get started, there are several things that I should point out. Although one of the techniques that I'll share with you is simple to use, the other techniques aren't for the faint of heart. You shouldn't attempt these other techniques unless you have a good understanding of the Windows 98 file system and are comfortable with the idea of working with the registry. As you probably know, working with the registry can be dangerous. Making a mistake in the registry can destroy Windows 98, your application programs, or both. Therefore, if you do decide to repair an extension yourself, please make sure that you have a good backup of your system just in case something goes wrong.
A simple repair
Usually, only a poorly written program will hijack a previously registered file extension without warning you. If you've had an extension hijacked, there's a good chance that the culprit was a shareware or other low-budget program. If the program that previously held the extension was a good-quality commercial program, then the solution to your problem may be as simple as checking your program options or properties. You may find a menu choice that offers to associate file types to that program. If you find such an option, you're back in business. Problem solved.
If no option exists, you can try reinstalling the program that previously held the extension. Often, the Setup program detects where the file extensions it wants to use are registered and will ask you if you want to change the extension to be associated with the program that you're installing.
A more complicated repair
Unfortunately, reinstalling the original program doesn't always work. Sometimes you have to revert to directly manipulating Windows. There are a couple of different ways of doing this. One method involves using Windows Explorer, while the other method involves using the Registry Editor. The differences are that the Windows Explorer method is safer and easier. However, there are a few things that you can do through the Registry Editor that you can't do through Windows Explorer.
Using Windows Explorer to repair associations
Before attempting to correct the problem using the Registry Editor, I recommend trying to correct the problem through Windows Explorer. To do so, open Windows Explorer and select the Folder Options command from the View menu. When you do, you'll see the Folder Options properties sheet. Next, select the File Types tab.
Listing file extensions
As shown in Figure A, the File Types tab contains a list of most of the registered file extensions and their corresponding programs. If you're trying to repair one particular registered file extension, the tricky part can be locating it, since the list is organized by program as well as by extension.
For this technique, it's necessary to browse through the programs on the list until you find the one that hijacked the file extension that you're trying to repair. To make matters more difficult, sometimes the program will show a different name on the list than it does on the Start menu. If you're having difficulty locating the program that hijacked the registered file extension, then you have two choices. You may either look at each program on the list so that you can see exactly which extensions that program has registered, or you can use the registry repair method that I'll discuss in a future article.
http://a1800.g.akamai.net/7/1800/259/1c7aa049adfe01/www.techrepublic.com/images/contentPics/r00320000928det03_01.gif
Editing file extensions
Once you've located the guilty program, you have some choices to make. If you select the program and click the Edit button, you'll see an Edit File Type dialog box similar to the one shown in Figure B. The first thing that you should check on this dialog box is the Default Extension For Content Type drop-down list. If only one extension is present on this list, then you have nothing to worry about—the repair will be easy. If there are multiple extensions, you'll be forced to use the registry to make the repair.
Figure B
http://a1800.g.akamai.net/7/1800/259/f2b8ccd17a1494/www.techrepublic.com/images/contentPics/r00320000928det03_02.gif
By looking at Figure B, you can see that the Edit File Type dialog box contains a set of buttons marked New, Edit, Remove, and Set As Default. These buttons affect the behavior of the file type's context menus. A context menu is the menu that you see when you right-click a file. The reason it's called a context menu is that the commands present on the menu differ depending on what type of file you've clicked on. For example, if you right-click an audio file, the menu may have a Play command (depending on what audio software has been installed on your machine). While a Play command would be suitable for an audio file, it wouldn't make any sense to have one on a spreadsheet's context menu. Therefore, the context menu's commands and the function of those commands are specific to the individual file types.
The New, Edit, Remove, and Set As Default buttons allow you to add, edit, or remove context menu commands from the file extension. For example, in Figure C, you can see the command associated with a bitmap file's Open action. Also in Figure C, you can see that unless the command is set to use DDE, the command is often merely a pointer to the executable file, followed by a variable such as %1. It's often possible to simply edit these commands to point to a different program. The command shown in Figure C will launch the Paint program and then try to open the .bmp file that was clicked on. However, you could easily change the command to point to another program. For example, if you wanted Notepad to attempt to open the file, you could change the command to C:\PROGRA~1\ACCESS~1\NOTEPAD" "%1. Of course in real life, you wouldn't want to make this change because Notepad can't open a BMP file, but you get the idea of how the command works.
------------------
"Those who cast the votes decide nothing. Those who count the votes decide everything." - Joseph Stalin
Sep 28, 2000
Talainia Posey
Have you ever been extension-jacked? It's happened to many of us. You have a favorite program that you use almost every day. One day, you install an unrelated program, and it takes over the file extensions that were registered by the other program. Now, when you double-click a file that was created by your other program, the new program launches and tries (usually unsuccessfully) to open the file. Fortunately, there are some ways to fight back when this situation happens to you. This article explains some techniques that you can use in a Windows 98 environment to restore file associations that have been taken over by a rogue program.What are file extensions?
File extensions are the three characters preceded by a period at the end of a file name, such as .txt, .doc, or .exe. Windows associates certain actions or programs with these extensions. For example, if you double-click an .exe file, Windows will assume that it's an executable program and attempt to load it, but if you double-click a .txt file, Windows will display the file in Notepad.
Before we begin
Before I get started, there are several things that I should point out. Although one of the techniques that I'll share with you is simple to use, the other techniques aren't for the faint of heart. You shouldn't attempt these other techniques unless you have a good understanding of the Windows 98 file system and are comfortable with the idea of working with the registry. As you probably know, working with the registry can be dangerous. Making a mistake in the registry can destroy Windows 98, your application programs, or both. Therefore, if you do decide to repair an extension yourself, please make sure that you have a good backup of your system just in case something goes wrong.
A simple repair
Usually, only a poorly written program will hijack a previously registered file extension without warning you. If you've had an extension hijacked, there's a good chance that the culprit was a shareware or other low-budget program. If the program that previously held the extension was a good-quality commercial program, then the solution to your problem may be as simple as checking your program options or properties. You may find a menu choice that offers to associate file types to that program. If you find such an option, you're back in business. Problem solved.
If no option exists, you can try reinstalling the program that previously held the extension. Often, the Setup program detects where the file extensions it wants to use are registered and will ask you if you want to change the extension to be associated with the program that you're installing.
A more complicated repair
Unfortunately, reinstalling the original program doesn't always work. Sometimes you have to revert to directly manipulating Windows. There are a couple of different ways of doing this. One method involves using Windows Explorer, while the other method involves using the Registry Editor. The differences are that the Windows Explorer method is safer and easier. However, there are a few things that you can do through the Registry Editor that you can't do through Windows Explorer.
Using Windows Explorer to repair associations
Before attempting to correct the problem using the Registry Editor, I recommend trying to correct the problem through Windows Explorer. To do so, open Windows Explorer and select the Folder Options command from the View menu. When you do, you'll see the Folder Options properties sheet. Next, select the File Types tab.
Listing file extensions
As shown in Figure A, the File Types tab contains a list of most of the registered file extensions and their corresponding programs. If you're trying to repair one particular registered file extension, the tricky part can be locating it, since the list is organized by program as well as by extension.
For this technique, it's necessary to browse through the programs on the list until you find the one that hijacked the file extension that you're trying to repair. To make matters more difficult, sometimes the program will show a different name on the list than it does on the Start menu. If you're having difficulty locating the program that hijacked the registered file extension, then you have two choices. You may either look at each program on the list so that you can see exactly which extensions that program has registered, or you can use the registry repair method that I'll discuss in a future article.
http://a1800.g.akamai.net/7/1800/259/1c7aa049adfe01/www.techrepublic.com/images/contentPics/r00320000928det03_01.gif
Editing file extensions
Once you've located the guilty program, you have some choices to make. If you select the program and click the Edit button, you'll see an Edit File Type dialog box similar to the one shown in Figure B. The first thing that you should check on this dialog box is the Default Extension For Content Type drop-down list. If only one extension is present on this list, then you have nothing to worry about—the repair will be easy. If there are multiple extensions, you'll be forced to use the registry to make the repair.
Figure B
http://a1800.g.akamai.net/7/1800/259/f2b8ccd17a1494/www.techrepublic.com/images/contentPics/r00320000928det03_02.gif
By looking at Figure B, you can see that the Edit File Type dialog box contains a set of buttons marked New, Edit, Remove, and Set As Default. These buttons affect the behavior of the file type's context menus. A context menu is the menu that you see when you right-click a file. The reason it's called a context menu is that the commands present on the menu differ depending on what type of file you've clicked on. For example, if you right-click an audio file, the menu may have a Play command (depending on what audio software has been installed on your machine). While a Play command would be suitable for an audio file, it wouldn't make any sense to have one on a spreadsheet's context menu. Therefore, the context menu's commands and the function of those commands are specific to the individual file types.
The New, Edit, Remove, and Set As Default buttons allow you to add, edit, or remove context menu commands from the file extension. For example, in Figure C, you can see the command associated with a bitmap file's Open action. Also in Figure C, you can see that unless the command is set to use DDE, the command is often merely a pointer to the executable file, followed by a variable such as %1. It's often possible to simply edit these commands to point to a different program. The command shown in Figure C will launch the Paint program and then try to open the .bmp file that was clicked on. However, you could easily change the command to point to another program. For example, if you wanted Notepad to attempt to open the file, you could change the command to C:\PROGRA~1\ACCESS~1\NOTEPAD" "%1. Of course in real life, you wouldn't want to make this change because Notepad can't open a BMP file, but you get the idea of how the command works.
------------------
"Those who cast the votes decide nothing. Those who count the votes decide everything." - Joseph Stalin