Jump to content

how to permanently assign an icon to a specific file type?


abbhishek

Recommended Posts


I may be wrong but changing the file type icon is a simple registry change. Since you cannot write-protect that key, you probably cannot prevent a program from changing the file type icon.

You probably could run a registry command that modifies that registry key back at every startup.

Link to comment
Share on other sites

I may be wrong but changing the file type icon is a simple registry change. Since you cannot write-protect that key, you probably cannot prevent a program from changing the file type icon.

You probably could run a registry command that modifies that registry key back at every startup.

which registry will i have to change??????

Link to comment
Share on other sites

I may be wrong but changing the file type icon is a simple registry change. Since you cannot write-protect that key, you probably cannot prevent a program from changing the file type icon.

You probably could run a registry command that modifies that registry key back at every startup.

which registry will i have to change??????

Under HKEY_CLASSES_ROOT look for the file extension key, .xxx. for example. Then look at the default data on the other pane and you will read something like xxxfile for example. Then, still under HKEY_CLASSES_ROOT look for the key that has this data name. Under that second key you'll find a default icon subkey. That's where it is.

Note that the default icon subkey can also be located under the first key but usually it is under the second one so that different file extensions can have the same commands and icon.

Any program you install may change the default data for the file extensions it will handle and consequently the location of the default icon key(s) of those extensions.

Edited by eidenk
Link to comment
Share on other sites

It's worth knowing as well that the above described way extensions associations and icons are managed can be overriden in at least two different ways. This means that you can see the entries in the registry as I have described them above but it is not what you get in explorer. It's quite unusual but it happens from time to time.

One applies only to icons and the other to extension associations as well. They are :

1) Icon handlers shell extensions. Those will be found in a shellex/iconhandler subkey in one of those three places : 1) under the file extension key itself, 2) under the filetype key the file extension key refers to, or 3) under the All Files key which is

HKEY_CLASSES_ROOT\*.

2) File extensions entries in HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts or HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.

No icons or associations will be specified there but only an executable name.

If this executable name has a subkey under the HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\Applications key and that this subkey contains a valid \Shell\....\Command and DefaultIcon subkey, those will override the standard command and icon for a given filetype.

In addition, but I don't know if this applies to NT systems but I think it does for 9x ones, entries in the win.ini file in the windows folder under [Extension] will also override the standard registry associations.

Edited by eidenk
Link to comment
Share on other sites

It's worth knowing as well that the above described way extensions associations and icons are managed can be overriden in at least two different ways. This means that you can see the entries in the registry as I have described them above but it is not what you get in explorer. It's quite unusual but it happens from time to time.

One applies only to icons and the other to extension associations as well. They are :

1) Icon handlers shell extensions. Those will be found in a shellex/iconhandler subkey in one of those three places : 1) under the file extension key itself, 2) under the filetype key the file extension key refers to, or 3) under the All Files key which is

HKEY_CLASSES_ROOT\*.

2) File extensions entries in HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts or HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.

No icons or associations will be specified there but only an executable name.

If this executable name has a subkey under the HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\Applications key and that this subkey contains a valid \Shell\....\Command and DefaultIcon subkey, those will override the standard command and icon for a given filetype.

In addition, but I don't know if this applies to NT systems but I think it does for 9x ones, entries in the win.ini file in the windows folder under [Extension] will also override the standard registry associations.

@eidenk thank you very much its great you added to my knowledge thank for sharing.............

Link to comment
Share on other sites

No problems.

You might want to have a look as well at a free program called Wassociate ( I recommend it all the time) which is IMO the best file association and filetypes icons manager.

It's way faster and easier to work with it than with regedit, it handles all the above stuff and allows even to quickly export the data of its panes to registry files so that you can easily save (and restore if needed) your associations and icons.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...