Fix Duplicate/Old Items on “Open With…” List in OS X

While installing Chrome on my new MacBook Pro I encountered a little error and the browser was not installed correctly.  I was able to fix the problem by reinstalling Chrome again, however I ended up with a duplicate “Google Chrome.app” on the “Open With” context menu list.

I went online and found this cool little snippet:

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

All you have to do is copy and paste this into Terminal and run it… (note: it takes a little bit of time for it to run so be patient)

Relaunch Finder (control+option+click on Finder icon in the Dock)…

Ta-da! The duplicate or old items are now gone!

Thank you Andrew Stevens for providing the snippet, and thank you My MacOS X for the Finder relaunch tip.

See Also:

lsregister – Reset the Launch Services database

 

8-17-2011 Update:

This code should work on both OS X Snow Leopard and Lion… I have not had the need to try it yet, but if you have, please let me know whether the code works on Lion as well.  Thanks! :)

12-8-2011 Update:

A reader confirmed that the code works on Lion as well.  Thanks for the feedback!

8-1-2012 Update:

Another commenter confirmed that the code works on Mountain Lion.  Thanks for the feedback!

8-5-2013 Update:

Thank you fpacheco for confirming the code works on Mavericks.

 

  • Steve Poulton

    On OSX Lion the command is
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

    • http://itpixie.com/ Amy P.

      Thank you Steve for the update for Lion! However that seems to be the same as the code I posted… I guess that code will work on both Snow Leopard and Lion.

      • David

        Indeed, your command does work on Lion. The missing step for me was the Finder relaunch — thanks for that.

        • http://itpixie.com/ IT Pixie

          Awesome! Thanks for the confirmation! Glad this was helpful to you! :)

    • Rolleric

      Or a little shorter (with soft links in the path and shortcut from -help info):

      /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain l,s,u

      This has been bugging me for ages….

  • ldrr

    great, works also on Mountain Lion!

  • Eduardo

    Also confirmed on Mountain Lion, great! Remember that the 3 lines above are a single command, and we must remove the CR before pasting into Terminal. Maybe the author might add backslashes at the end of the first 2 lines so that we can paste the code above “as is”. Thanks for the great tip, I had 5 copies of Xcode plus a few other duplicities in my menu…

    • http://itpixie.com/ IT Pixie

      Thanks! And thank you for the tip on the code. I have updated the post to make the code copy-and-paste “as is”.

  • nervouna

    Thank you so much! This worked for me.

  • Larryzh

    It works well for Mountain Lion by now

  • Anton Fonarev

    Thank you!

  • Ric

    Just ran it on 10.8.2 and it worked like a charm! Many thanks!

  • Trismegister

    Just like to add that this sorted out the problem I had on Mountain Lion after I installed Adobe Creative Suite CS6 and removed the CS3 versions of the creative suite programs. The “Open with” menu was still showing the CS3 programs. This command removed these (and other!) invalid and redundant / removed program names from from the drop-down menu.
    Thank you for posting this solution.

  • jeppe

    Works perfectly on Mountain Lion… Thanks

  • Aber1Kanobee

    Works great! Thanks for the tip-The whole “duplicates thing” while using “open with” was really buggin’ me.

  • Tim

    One important thing… be sure to restart your finder.

  • Richard

    thx a lot!

  • http://www.facebook.com/philbar Phillip Barnes

    Thanks! This problem has bugging me for a long time now. Using OS X 10.8.2

  • Pingback: joshaust.in Multiple Entries in Finder’s “Open With…” Menu

  • Andrej

    Awesome! Works like a charm on Mountain Lion!

  • MM

    Thanks for this awesome tip! However on Mountain Lion you can relaunch Finder, at least I couldn’t find it with ctrl+opt+click with mouse. All I did was just closing all Finder windows and click on the Finder icon to relaunch.

  • krencey

    WOW, thank you, BIG TIME! I had this very same issue on my mountain lion for some time. THX

  • jm

    perfect code, thanks

  • Logesh R

    Thank you! i got it working in Mountain lion!

  • Tommaso Ferrari

    Worked perfectly on Mountain Lion.
    Thank you.

  • http://twitter.com/JacobSyndeo Jacob Pritchett

    THANK YOU SO MUCH!! :D

  • pookietookie

    Thank you for this!! Worked perfectly on Mountain Lion where I had dupe entries for VLC player and Evernote. I’d love to know why this works. Any chance you could explain? In a million years I would never have thought to do this…

    • http://itpixie.com/ IT Pixie

      Here’s an explanation of how to use “lsregister”: http://ss64.com/osx/lsregister.html

      Essentially the command resets the local, system and user domains.

  • http://twitter.com/markjharvey Mark Justin Harvey

    worked on ML 10.8.2, thanks a lot!

  • bootak

    Works on Mountain Lion 10.8.2. Wonder why duplicates happen?

  • raycn

    nice, i just found that finder can relaunch

  • nmquyet

    good tips. it saves my day. Thanks

  • http://twitter.com/kklamarie Kayla Marie

    Thank you! Worked like a charm on my mac mini running 10.7.5. The terminal code also took about 5 seconds to run, so it was a very quick fix!

  • fpacheco

    Works on Mavericks

    • http://itpixie.com/ IT Pixie

      Thank you for confirming! :)