Windows and file name extensions

Extensions and file types

Based on the extension of a file name the windows shell (Explorer, command.com, cmd.exe, common file dialogs, etc.) determines what should happen when you manipulate a file.
Windows associates file extensions with a file type or with a class or with both.

File types

Often more than one extension will be associated with one file type. The file extensions and file types are stored in the Windows registry and describe the properties of files with the specified extensions.
For instance, .txt is often associated with the file type txtfile, describing the way files with extension .txt should behave in Explorer.

Classes

A file extension can be associated with a class by a unique identifier called CLSID. Like a file type a class can specify properties for file extensions.

Shell verbs

One of the things a file type, like txtfile, or class can specify is the command to execute when double clicking on an associated icon. A file type can have more than one shell command associated with it. The Windows shell will summarize the available commands for a file type when the user right-clicks a file, and present them in the alternate popup menu, ready to launch.
Windows summarizes these commands as verbs in its registry.

Other ways of editing associations

You can use the dialogs found in Explorers menu View - Options - File Types, to edit associations. When you double click a file of which the extension is still unknown to the Windows shell, you get a dialog box asking you which program to start. If you check the 'Always use this program' check box, and click OK, you establish an association between the file extension and the program just selected. With RegEdit you can find the associations used on your machine beneath the registry key HKEY_CLASSES_ROOT.

Documentation

Names of file types you can encounter in your registry like txtfile, bmpfile, Folder, Unknown, * might give you a impression of what they stand for. Documentation of some of the settings can be found on your Windows CD-ROM. For Windows 95 users in the Windows 95 Resource Kit, for NT users in the NT On-line books. Additional information for programmers can be found in the Win32 SDK.

Using WAssociate