How to fix lsregister failing associations after reboot? [duplicate]

I'm running 10.7.5 and I have noticed a problem with associations between files and applications. The main symptom is that Finder shows more than one copy of the same application to open a file.

At first everything worked, but now the com.apple.LaunchServices.plist file is not updated anymore. In particular, if I launch through terminal lsregister -dump the association appears, but if I open the plist file the association is not present. If I reboot, instead of updating the plist file, the system eliminates the association from the database (the option -dump doesn't show it anymore). I tried to launch lsregister -kill -seed several times, but the situation doesn't change.

How can I permanently fix the associations between files and applications?


Solution 1:

The LaunchServices database is built with data from as many as four domains. (See 'lsregister --help' for more info on these domains.) You might not be rebuilding the LaunchServices database correctly. This is the command I use to rebuild the database on my Mac:

sudo /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

If you really want to get into the nitty gritty of file associations (plus a whole lot more) and want a nice GUI to boot try installing RCDefaultApp.

http://www.macupdate.com/app/mac/14618/rcdefaultapp