Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 3.27 / 5
  You rated: 5 / 5 (11 votes cast)
 
[207,867 views]  

How to rebuild the LaunchServices database | 38 comments | Create New Account
Click here to return to the 'How to rebuild the LaunchServices database' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to rebuild the LaunchServices database
Authored by: semiotek on Jan 05, '04 10:38:14AM

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 Jan 05, '04 01:50:06PM

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 Jan 05, '04 01:55:20PM

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 Dec 27, '04 12:10:46PM

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 Jan 05, '04 01:54:26PM

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 Jul 27, '05 08:40:33AM

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 Aug 04, '05 03:38:07PM

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 Jan 05, '04 02:23:57PM

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 Jan 05, '04 02:57:01PM

My mp3 files had strange icons.

A reboot fixed me right up.



[ Reply to This | # ]
me too
Authored by: VEGx on Jan 06, '04 09:00:21AM

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 Jan 06, '04 03:58:27AM

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 Feb 03, '04 07:26:43PM

CF must refer to CoreFoundation.



[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: Anonymous on Jan 06, '04 05:42:24AM

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 Jan 07, '04 10:37:31AM

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 Jun 09, '04 12:14:29AM

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 Oct 04, '04 11:24:21PM

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 Oct 04, '04 02:22:58PM

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 Jul 19, '05 06:42:23PM

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: litedesign on Aug 10, '05 12:30:42PM

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 Nov 07, '05 02:26:16AM
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 Nov 16, '05 04:24:02PM

Alright! That one did the trick!



[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: PeaceFreak on Dec 16, '05 09:15:47PM

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 Jun 19, '07 03:43:39AM

I can confirm this worked for me on 10.4.9.



[ Reply to This | # ]
Fixes other issues, too
Authored by: xeroply on Jan 15, '06 11:44:39PM

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 Jun 11, '06 01:41:04PM

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 Mar 10, '07 07:53:07AM

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 Mar 31, '07 03:13:35PM

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 Oct 19, '07 05:06:53AM

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 Nov 04, '07 06:52:36AM

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 Nov 17, '07 03:46:25AM

worked for me too on 10.5.1

---
~/.sig: not found



[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: diroussel on Jan 08, '08 03:20:31PM
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 Jun 08, '08 06:04:21AM

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 Aug 20, '08 02:31:35AM

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 Jun 14, '09 09:42:06AM
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 - the GUI-phile / shell-phobic way
Authored by: jtillford on Sep 28, '09 11:56:35PM
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 Sep 29, '09 09:04:37AM

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 | # ]
Use Onxy rebuild launchservices to fix the problem
Authored by: DogDutyAscetic on Aug 21, '10 08:06:56AM

10.6.4 here and I used Onxy maintenance > rebuild > launchservices. Fixed the problem. Onxy is a free program.



[ Reply to This | # ]
How to rebuild the LaunchServices database
Authored by: scheeko on Sep 07, '12 10:45:22AM
On 10.8 Mountain Lion: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

[ Reply to This | # ]