Reset 'Open With' Dialog in Finder

After the upgrade of several programs I found that these programs had multiple entries in the 'Open With' dialog in OS X Finder. The following command (executed in the Terminal app) rebuilds the LaunchService database, and removes the duplicate entries.

Note that the following command is 1 (one) line of code, that you need to copy & past in the terminal window.

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

As far as I can tell, it works on OS X Mountain Lion and every earlier version (at least till 10.6).

Posted on July 29, 2012 and filed under Apple, Operating Systems, Tips'n Tricks.