Registered file types Windows 95 uses registered file types to associate each file extension with a specific application. The usual way to modify file type associations is through the File Types tab that's shown in Figure A. You can access the File Types tab through Windows Explorer by selecting View/Options... and clicking on the File Types tab. If you have Internet Explorer 4.0's Active Desktop installed, the View menu will list Folder Options instead.
Figure A: Use the File Types tab to associate file extensions with specific
applications.
With registered file types, you have the ability to designate actions to each file type as well as specify what the default action should be. For example, if the default action for the Microsoft Word Document file type is Open, the document will open when you double-click on it. Adding specific actions to file types can save time as well as simplify tasks.
Editing incorrect extension associations Not all applications adhere to the rules when it comes to file extension associations and this can cause problems. Fixing incorrect file type associations through the File Types tab can be a lengthy process. To remove an extension from a file type, you'd have to delete the registered file type and then rebuild from scratch. Rather than going through all that work, you can save time by using the Windows 3.x File Manager to correct the problem. To access File Manager through Windows 95, choose Start/Run.... In the Open dropdown list box, type Winfile and press [Enter]. As Figure B shows, you should now be looking at the Windows File Manager. Doesn't this bring back memories?
Figure B: Save time removing incorrect file associations by using Windows 3.x File
Manager.
Next, select File/Associate... to correct the erroneous association. For this example, we're going to assume that all files with the .DOC extension have been incorrectly associated. In the Files With Extension text box, type .DOC. As Figure C shows, the current application that .DOC files are associated with automatically fills in the Associate With text box. Currently, all .DOC files are incorrectly associated with Notepad. Therefore, if you double-click on a .DOC file that you created in Word, Notepad will open showing nothing but garbage characters.
Figure C: File Manager's Associate dialog box shows that .DOC files are incorrectly
associated with Notepad.
To change the association to the correct application, simply scroll through the list box and select Microsoft Word Document. Click OK to confirm the association of .DOC files with Microsoft Word documents. Exit Windows File Manager and go back to Explorer, choosing View/Options... and then clicking on the File Types tab. As shown in Figure D, Microsoft Word Document now exists in the list of File Types and has a .DOC extension.
Figure D: The Microsoft Word Document file type now exists in Windows 95's File Types
tab.
Removing file type restrictions Microsoft has made dealing with registered file types even more difficult by disabling many of the options for the most critical file types. As the Edit File Type dialog box in Figure E shows, you're unable to use the Edit..., Remove, and Set Default buttons for the MS-DOS Batch File type because they're all disabled. Windows 95 doesn't allow modifications to Application, MS-DOS Batch File, Drive, and Folder file types to prevent your users from accidentally disabling critical functions.
Figure E: Windows 95 limits your ability to modify certain file types.
Unfortunately, this restriction prevents you from adding or altering any actions for these existing file types. For example, suppose that you'd like to change the default application used to edit batch files. With the current restrictions, you'd be unable to do so.
To remove the restrictions on the MS-DOS Batch File, or any file type for that matter, you'll need to edit the registry. Before editing the registry, as always, it's very important to create a backup that you can restore in case you run into problems.
In order to run the Registry Editor, choose Start/Run... and in the Open dropdown list box type REGEDIT and click OK. Drill down to the HKEY_CLASSES_ROOT\batfile subkey. The subkey you want to alter will always be the internal name for the extension associated with the file type. Batfile is the internal name for the .BAT extension that's associated with MS-DOS batch files. As a result, this method will only work for file types that have an associated extension.
Once you've located the correct subkey, change the EditFlags value in the right-hand pane to 00 00 00 00, as Figure F shows. By setting this value, you remove all restrictions on a file type, thereby allowing you to make any changes. As you can see in Figure G, you'll now be able to use the Edit..., Remove, or Set Default actions for an MS-DOS batch file.
Figure F: You can remove the restrictions on any file type by changing the EditFlags
value through the Registry Editor.
Figure G: The MS-DOS Batch File type now has no restrictions.
Use caution As we stated previously in this article, these restrictions on file types exist mainly for your own protection. Before setting the EditFlags value to 00 00 00 00, it's important that you write down the original value. We recommend that you reset the value once you've completed the necessary changes to prevent users from doing any damage. Conclusion With the countless applications that exist today, keeping track of your file extensions can be a nightmare. To find out what application a certain extension is associated with, visit www.whatis.com. Here, you'll find a vast list of alphabetically sorted extensions. If you'd like more information on registered file types, refer to the article "Understanding Windows 95 File Associations" in the August 1997 issue.
Changing a file type association on the fly When you double-click on a file, that file will open with the application that's associated with that file type. As we've shown, you can change the association for a file type by choosing View/Options..., and selecting the File Types tab. However, if you want to view the file in another application on a one-time basis, you may do so through the context menu. Simply hold down the [Shift] key while you right-click on the file and select Open With.... You can now select an application, other than the currently associated one, from the Open With... dialog box. The next time you double click on the file, it'll open with the application that it was previously associated with. |