| When using Explorer you can associate applications with file extensions.
You can also associate an icon that matches the program and also include a description of
the file type in the type column. This information is stored in the registry and you can
create new entries as well as editing existing entries. Open up the registry editor and
open the HKEY_CLASSES_ROOT section. This section contains all the class information for
your local machine. You will notice all the file extension mappings close to the top of
the list. The classes match the name of the file extension, for example text files
associated with the .txt extension are under a class called .txt. Open an extension and
look at the default string. The default string for the extension is the name of the
application class that deals with that particular file type.
Make a note of the application class and then scroll down the list of classes, you will
also find the name of the application class under HKEY_CLASSES_ROOT. Open up the
application class and look at the default string for the application class. This default
string is the text that will appear in the type column in explorer. Under the application
class will also be a key called DefaultIcon the default string for this key is the path to
the icon to be displayed for this file type in explorer.
The application class also contains a key called shell this key contains all the
commands that your file extension can accept. The one we are interested in is called open,
this is the command that is used to "open" the file with. Under the open key is
a key called command, the default string for this key is the path and filename of the
executable used to open this file. A %1 at the end of the file name is used to substitute
the name of the selected file in explorer to the application as the first parameter.
Example for WinZip Application:
| .zip |
(Default) |
= |
"WinZip" |
|
|
|
| |
|
|
|
|
|
|
| WinZip |
(Default) |
= |
"WinZip File" |
|
|
|
|
DefaultIcon |
(Default) |
= |
"c:\winzip\winzip.exe,0" |
|
|
|
Shell |
|
|
|
|
|
|
|
Open |
|
|
|
|
|
|
|
Command |
(Default) |
= |
"c:\winzip\winzip.exe" %1 |
You can alter existing entries to change the icons and text for your favourite
applications or create new extensions, descriptions and icons for your own file types. You
will also have to reboot your PC to see the changes as this data is cached by windows when
the OS starts. |