How To Rebuild LaunchServices to Remove Duplicates from "Open With" Menu
Posted 12/07/2010 at 10:53am
| by Cory Bohon
Have you ever used the right-click "Open With" feature in Finder when opening a specific type of file? While this feature is usually pretty handy, if you install and remove applications on a regular basis there may still be traces of those applications that have been long-gone from your Mac. In this how-to, we'll show how you can rebuild this list so it remains up-to-date and only shows what you currently have on your hard drive.
Typically your LaunchServices database needs rebuilding when you right-click on a file and go to the "Open With" menu and notice that application icons are missing and there are duplicates. This problem can also be stemmed from virtual machines in VMWare or Parallels that don't clean up after themselves, leaving traces of uninstalled applications behind. This, however, is easily fixed by typing a simple command into Terminal in OS X.

Screenshot before rebuilding launch services database.
If you're running OS X Leopard (version 10.5.x) or Snow Leopard (version 10.6.x), you'll need to enter the following command into Terminal (located in /Applications/Utilities), followed by the enter key. You can also copy and paste the following command:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
If you're running OS X 10.3.x (Pather) or 10.4.x (Tiger), then type this command into Terminal followed by the enter key:
/System/Library/Frameworks/ApplicationServices.framework/\Frameworks/LaunchServices.framework/Support/lsregister \-kill -r -domain local -domain system -domain user

After you enter the command, you'll notice several lines of text pop up in the Terminal. Ignore them, but don't close the Terminal window until you notice the Terminal prompt (denoted by the User$ text) return to the screen, followed by the blinking cursor. When this appears, you can close the Terminal application.

After rebuilding launch services database
After you've run this command and re-open the Open With menu, you should notice a slimmed down menu that contains only relevant and installed applications that can open the file. You can run this command as needed to rebuild the LaunchServices database should you run into this issue again.
Follow this article's author, Cory Bohon on Twitter.