Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

How to rebuild the LaunchServices database System
If your "Open With" menu shows applications that are no longer installed, or shows some of them as duplicates, you can use the following Terminal command to rebuild your LaunchServices database:
/System/Library/Frameworks/ApplicationServices.framework/\
Frameworks/LaunchServices.framework/Support/lsregister \
-kill -r -domain local -domain system -domain user
Just calling lsregister by itself will show some explanation:
lsregister: [OPTIONS] [-domain { system | local | user | network }]... [path]...
Search the paths for application bundles and add each found item to the Launch
Services database.  For domain specifications, ask CF for the list of application
locations in the given domain(s).

  -kill     Reset the global Launch Services database before doing anything else
  -lint     Print information about plist errors while registering bundles
  -convert  Register apps found in older LS database files
  -load     Load the LaunchServices service plugin if it's not already loaded.
  -lazy n   Sleep for n seconds before registering apps if the local cache
            is aleady populated.
  -r        Recursively register directory contents, do not recurse into
            packages or invisible directories.
  -R        Recursively register directory contents, including the contents
            of packages and invisible directories.
  -f        force-update registration info even if mod date is unchanged
  -v        Display progress information.
  -dump     Display full database contents after registration.
  -h        Display this help.
    •    
  • Currently 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[133,894 views]  

How to rebuild the LaunchServices database | 39 comments | Create New Account
Click here to return to the 'How to rebuild the LaunchServices database' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
How to rebuild the LaunchServices database
Authored by: semiotek on Mon, Jan 5 2004 at 10:38AM PST
I can't see it, but a "?" pops into the command when I paste it into Terminal. If anyone else has the same problem, you could try pasting into a text editor, deleting the backslashes and excess spaces, and then copying and pasting the result into Terminal. It worked for me!

Apart from that, I'm really grateful for this hint - I'm the kind who gets really irritated by three copies of GraphicConverter in the Open With list!

Many thanks - Nick

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: joey03 on Mon, Jan 5 2004 at 1:50PM PST
When I type "lsregister" in Terminal (bash or tcsh shell), I get "command not found" in 10.3.2. Anyone else?

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: semiotek on Mon, Jan 5 2004 at 1:55PM PST
Would that not be because the directory where it is to be found is not in your search path? That must be why the hint includes the complete path to it.

Nick

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: allenwatson on Mon, Dec 27 2004 at 12:10PM PST
When I used the lsregister command as given in the hint, with the full path, it did not work. I had to do "locate lsregister" to find the complete path for my system, which included two "Versions/A" folders in the folder tree.

/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister

Whatever the path is for your system, "locate" should find it for you.

---
Microsoft MVP for Entourage
AppleScripts for OE and Entourage

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: mnewman on Mon, Jan 5 2004 at 1:54PM PST
If you use this hint and have applications located someplace other than /Applications you need to append the path to the end of the command. The first time I ran it without any paths and my LaunchServices database included only applications on the boot volume.

---
Mike Newman
Saipan and Narita Layover Pages:
http://net.saipan.com/personal/mike_newman/

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: UnknownPPC on Wed, Jul 27 2005 at 8:40AM PDT
I had a strange problem in Tiger that when I clicked on a folder in the dock or dragthing it would launch iPhoto or Entourage. Running this command fixed everything.

---
-Mr. Unknown-

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: luhmann on Thu, Aug 4 2005 at 3:38PM PDT
I tried a couple of hints here. This is the one that finally worked for me. I added -f, and I also appended the path to my personal applications folder (within the applications folder) at the end:

/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -f -domain local -domain system -domain user "/Applications/MyApps"

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: ddelo on Mon, Jan 5 2004 at 2:23PM PST
I tried this hint and it worked by removing duplicate items in my Open With contextual menu. But now, it seems the icons on certain file types are wrong even though double clicking on them opens them up in the correct application.

Has anyone seen this too and/or know how to fix it? ;-)

[ Reply to This | # ]
me too
Authored by: rootpoot on Mon, Jan 5 2004 at 2:57PM PST
My mp3 files had strange icons.

A reboot fixed me right up.

[ Reply to This | # ]
me too
Authored by: VEGx on Tue, Jan 6 2004 at 9:00AM PST
When I have strange icons, at times, quiting Finder usually takes care of that...

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: Ganymede on Tue, Jan 6 2004 at 3:58AM PST
I'm still running 10.2.8, plan to install Panther this next week. Neither the path nor the command (-kill) worked for me as is. I found the app at ...LaunchServices.framework/Versions/A/Support/lsregister. Upon invoking the hint's command line using my path, I got the "usage" spiel: different from that listed by the hint's author, mine does not include -kill, -lint, -f or -dump.

When I tried the command with my path and leaving out the -kill switch, it seemed to work. As I've not been having any trouble with "Open with" and allies, I saw no result. A little anti-climactic, but filed away for future reference. Thanks very much!

btw, who (or what) is CF that we should ask about the domains' applications locations?

Ganymede

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: maparent on Tue, Feb 3 2004 at 7:26PM PST
CF must refer to CoreFoundation.

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: frjo on Tue, Jan 6 2004 at 5:42AM PST
Thank you for this tip! Ever since I upgraded to Panther I get a lot of double entries in the Open with... context menu, seems to be gone now.

[ Reply to This | # ]
Strange side affects
Authored by: jecwobble on Wed, Jan 7 2004 at 10:37AM PST
I tried this hint and it appears to have cleaned up my "Open with" context menu. But a strange thing happened afterward that may or may not have been related. I have an external FireWire drive mounted. As some of you know, this shows up on your desktop even when your Finder preferences are set to not display dirves in 10.3. You can remove it from the desktop by also not displaying CDs, DVDs and iPods, which I chose not to do- I lived with it on my desktop even though I don't want it there.

But immediately after using this hint, my drive disappeared from my desktop. It's still visible in the left-hand portion of my Finder windows and I can access it from there (which I much prefer). But no matter what Finder preferences I set, it never shows up on my desktop. I've rebooted twice and it still won't show up.

Not a bad thing in my case, but a little alarming nontheless. Has anyone else experienced this behavior after using this hint?

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: fortepianissimo on Wed, Jun 9 2004 at 12:14AM PDT
If you tried this with the most recent security update installed

http://docs.info.apple.com/article.html?artnum=61798

You'll be asked many times when you try to open some documents the first time. Type "lsregister -dump | less" will show you that all entries for third-party applications now have the form like this:

B00001546 APPL/CHIM Tue Jun 8 15:16:55 2004 Camino.app
-pad----hn---sr-----! v0.8.0 Camino
Contents/Resources/appicon.icns org.mozilla.navigator
Contents/MacOS/Camino 6263372, 6263906, Mach-O
V00000008 /Applications/Internet/Camino.app

Note the ending '!' - that means it's never been run before.

I wonder if there's a way to reset all of these '!' using some tool.

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: heyotwell on Mon, Oct 4 2004 at 11:24PM PDT
I'm running 10.3.5, which includes those security updates, and this hint worked great for me.

I used the System Migration tool on a new Powerbook to pull the account information from an old one, and the only (knock wood) problem was that the Open With... menu was bloated with double entries for everything. This hint solved the problem quickly and easily.

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: valx on Mon, Oct 4 2004 at 2:22PM PDT
In case anyone runs into the error message application [application name] cannot be launched because it may be damagaed or incomplete, rebuilding the LaunchServices database using the command from this hint may fix it.

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: MacOfTheEast on Tue, Jul 19 2005 at 6:42PM PDT
I had no luck until I added the -f (force-update registration info even if mod date is unchanged) switch to the command line like so...

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

Fixed me right up!

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: decor on Wed, Aug 5 2009 at 5:57PM PDT
Thank you this made it work for me as well. Saved me heaps of time. natural stone

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: litedesign on Wed, Aug 10 2005 at 12:30PM PDT
I have tried every iteration of the command listed here, but I still have 4 instances of Adobe Acrobat 6.0.3 listed in my "Open With" menu.

When I add -v to the command, it shows me a long list of errors:
"error 10811 registering <filename> "

Any ideas why?

Ethan

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: fx2ooo on Mon, Nov 7 2005 at 2:26AM PST
Hope I can keep this thread going a bit longer... I tried the command given (adding the -f):

/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServices.framework/Support/lsregister 
-kill -r -f -domain local -domain system -domain user
I got a 'no such file or directory' result. Following the path, I found that the Support folder was an alias. Using the pathname to the original worked like a charm:

/System/Library/FrameWorks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister 
> -kill -r -f -domain local -domain system -domain user
Have wanted to fix this for who knows how long. Thanks a lot! Just a tidbit: if you still have multiple copies of Opera in this menu, as I did, check your Studio MX 2004 Flash and Contribute directories if you have them.

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: litedesign on Wed, Nov 16 2005 at 4:24PM PST
Alright! That one did the trick!

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: PeaceFreak on Fri, Dec 16 2005 at 9:15PM PST
This worked for me:

/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -f -domain local -domain system -domain user "/Applications"

Just wish there was a way to manually edit the applications in the list as there are many listed that I never use!


[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: The - DDD on Tue, Jun 19 2007 at 3:43AM PDT
I can confirm this worked for me on 10.4.9.

[ Reply to This | # ]
Fixes other issues, too
Authored by: xeroply on Sun, Jan 15 2006 at 11:44PM PST
I had applications that were opening Script Editor instead of the desired application. (i.e. double-clicking InDesign 2.0.1 would open Script Editor instead of InDesign)

Applying the command in this hint seems to have resolved that issue.

Thanks!

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: AquaX on Sun, Jun 11 2006 at 1:41PM PDT
I can confirm this works with 10.4.6, but by using 'locate lsregister' first.

Thanks!

[ Reply to This | # ]
Easy way to get any command to execute
Authored by: cellocgw on Sat, Mar 10 2007 at 7:53AM PST
I see from the comments that many here are not familiar with Unix. Here's the way to run any command that is in your currrent directory.

[your_prompt]: ./CommandName

The trick is that many shells (tcsh, bash, etc) don't include the current working directory in their .cdpath list. "." is shorthand for "where I am right now," so "./command" will always work

Carl


[ Reply to This | # ]
Easy way to get any command to execute
Authored by: baltwo on Sat, Mar 31 2007 at 3:13PM PDT
I'm confused by your comment. AFAICT, it implies that you don't need the path to lsregister. However, when I run this, it doesn't do what I inferred.

localhost:~ baltwo$ ./lsregister
-bash: ./lsregister: No such file or directory

Please clarify.

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: hypert on Fri, Oct 19 2007 at 5:06AM PDT
This is still a very useful hint - I just used it today. Thanks!

Wish Apple had a GUI or a cron that took care of this for us though...

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: rpalmeri on Sun, Nov 4 2007 at 6:52AM PST
and here's how to use this hint in Leopard, which has moved the location of the file.
Open a Terminal window and type in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister \ -kill -r -domain local -domain system -domain user

This worked for me, but YMMV, so use at your own risk.

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: adrianm on Sat, Nov 17 2007 at 3:46AM PST
worked for me too on 10.5.1

---
~/.sig: not found

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: diroussel on Tue, Jan 8 2008 at 3:20PM PST
In Mac OS X 10.5.1 it seems the command line option have changed to:

sregister: [OPTIONS] [ <path>... ]
                      [ -apps <domain>[,domain]... ]
                      [ -libs <domain>[,domain]... ]
                      [ -all  <domain>[,domain]... ]

Paths are searched for applications to register with the Launch Service database.
Valid domains are "system", "local", "network" and "user". Domains can also
be specified using only the first letter.

  -kill     Reset the Launch Services database before doing anything else
  -seed     If database isn't seeded, scan default locations for applications and libraries to register
  -lint     Print information about plist errors while registering bundles
  -convert  Register apps found in older LS database files
  -lazy n   Sleep for n seconds before registering/scanning
  -r        Recursive directory scan, do not recurse into packages or invisible directories
  -R        Recursive directory scan, descending into packages and invisible directories
  -f        force-update registration even if mod date is unchanged
  -u        unregister instead of register
  -v        Display progress information
  -dump     Display full database contents after registration
  -h        Display this help
So I used:

`locate lsregister` -kill -r -all local,system, user
Seemed to work fine.

[ Reply to This | # ]
TinkerTool System does the job
Authored by: alec kinnear on Sun, Jun 8 2008 at 6:04AM PDT
I couldn't get this command to run successfully from the command line even using sudo.

Happily enough TinkerTool System from Marcel Bresink includes a rebuild Launch Services feature User - > Launch Services which took care of the problem in 20 seconds. Finally I can right click jpegs again!

Thanks for the tip anyway.

---
WordPress SEO Secrets - foliovision.com/weblog

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: leonAzul on Wed, Aug 20 2008 at 2:31AM PDT
Here's an AppleScript that can be saved as a script and launched from the Script menu, or saved as an application and launched from anywhere.

(*
rebuildLaunchServicesDB.scpt
Locates the lsregister command regardless of OS version, then tells it to rebuild the Launch Services Database for all applications in the canonical Applications folder
Paul Henegan
bleulyon@mac.com
20.Aug.2008
*)

set theCommand to (do shell script "locate lsregister")
set theArguments to " -kill -r -f -domain local -domain system -domain user"
set thePath to " /Applications"--edit this as needed
set theScript to theCommand & theArguments & thePath
do shell script theScript


[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: Roberto123 on Sun, Jun 14 2009 at 9:42AM PDT
appears to have cleaned up my "Open with" context menu. But a strange thing happened afterward that may or may not have been related. I have an external FireWire drive mounted. As some of you know, this shows up on your desktop even when your Finder preferences are set to not display dirves in 10.3. You can remove it from the desktop by also not displaying CDs, DVDs and iPods, which I chose not to do- I lived with it on my desktop

[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: Mike1980 on Sat, Jun 20 2009 at 5:46AM PDT
How to rebuild the LaunchServices database
Authored by: llucia0949 on Fri, Aug 14 2009 at 2:54AM PDT
Thank you for your helpful information!
oDay Downloads

[ Reply to This | # ]
How to rebuild the LaunchServices database - the GUI-phile / shell-phobic way
Authored by: jtillford on Mon, Sep 28 2009 at 11:56PM PDT
This is a great tip and many, myself included, are perfectly comfortable mucking about in the shell.
But for those of you that get nervous at the mention of Terminal.app, there is a graphical alternative for this hint.

The popular utility Cocktail can rebuild the Launch Services database with a simple GUI click.

Happy DB rebuilding.

[ Reply to This | # ]
How to rebuild the LaunchServices database - the GUI-phile / shell-phobic way
Authored by: tedw on Tue, Sep 29 2009 at 9:04AM PDT
just in fairness, there are a number of 'service utility' apps that do this - Yasu and Onyx are two the spring to mind. or you can do what I did - write the code into an applescript and save it in the script menu. that way you only have to deal with the terminal command once.

[ Reply to This | # ]