Saving and Restoring File Associations

Wondershare DVD Slideshow Builder Deluxe
When you double-click on a file to open it, say a JPG image, Windows uses information stored in its registry to determine what program to use to open a file of that particular type. The information is stored at two places in the registry. One is HKEY_CURRENT_USER\Software\Classes and the other is HKEY_LOCAL_MACHINE\Software\Classes, which is shown in the figure below.

Registry file associations
for all users

The HKEY_LOCAL_MACHINE\Software\Classes valus apply to all accounts on the system. But if there is an entry for a particular file type in HKEY_CURRENT_USER\Software\Classes for the user account currently logged in, then that entry will override the one in HKEY_LOCAL_MACHINE\Software\Classes If there is an entry for a particular file type, say JPG, under HKEY_CURRENT_USER\Software\Classes that indicates JPG files should be opened with Corel PaintShop Pro, then that is the program that will open a JPG file when that particular user double-clicks on it. On the same system, another user might have a different value for JPG, say Adobe Photoshop, so when the second user has logged in under her account, a different value will be visible under HKEY_CURRENT_USER\Software\Classes\.jpg

You may want to save the file associations prior to installing a new program that may change the associations. Some programs will change file associations to themselves without asking. Others will ask you, but you may later decide that you would prefer to have the old associations, so that the program that used to open a particular file type, say JPG images, will once again open those images when you double-click on them, even though you might still want to keep the new program on the system. To preserve the file associations for later restoral you can take the steps listed below.

Steps to save and restore Windows file associations.

  1. Click on Start.
  2. Click on run.
  3. Type regedit and click on OK.
  4. Navigate to HKEY_CURRENT_USER\Software\Classes. This is where Windows stores information on file associatiions for the user acount under which you have logged into the system. E.g in the figure below, Windows will use Kodak EasyShare to open JPG images (you have to look for EasyShare.jpg in another section of the registry to see exactly how JPG files are opened in this case, which is shown in EasyShare.JPG).
  5. Current User File Associations for JPG

  6. Right clock on Classes and choose Export.
  7. Export file associations

  8. Browse to where you want to save the registry file (it will have a .reg extension) and select a name for the file, e.g. user-file-associations. Leave "selected branch" set to HKEY_CURRENT_USER\Software\Classes and click on the Save button.
  9. Export file associations

You will need to follow a similar procedure for the HKEY_LOCAL_MACHINE\Software\Classes section of the registry to preserve the global settings that apply to all system users. Create another file for those settings, e.g. allusers-file-associations.reg

If you ever need to restore the user file associations to the ones you had when you created the file, you can just-double-click on one or both of the backup files you created to restore your settings. If an installation changed only the associations for the currently logged on user, you could use use the file you created that holds the registry settings for that user. If you are unsure whether the application changed the global settings or just the currently logged on user's settings, you could double-click on both files you created to restore all of the pevious settings.

If you have added new file associations since you created the backups, those will remain, since reimporting these settings into the registry overwrites any matching registry keys, but does not delete any keys not in the saved registry associations file. E.g. if you installed a program called EZ-XYZ that creates files with an extension of .xyz, which associated itself with such files when you installed it, then,if there was no program associated with xyz files when you created the registry backup as outlined above, then when you restore the file association settings in the registry from a backup you created, EZ-XYZ will still be associated with .xyz files after you restore from the backup registry file or files.


TechRabbit ad 300x250

Justdeals Daily Electronics Deals1x1 px

Valid HTML 4.01 Transitional

Created: September 25, 2006