Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: Rebuild the launchservices database System 10.5
It happens now and then that when you control-click on a file to use the Open With contextual menu, you'll see double entries, and even removed applications, in the list of available applicatiopns. A rebuild of the LaunchServices database is then the solution. (This also happened in Tiger.)

The path to the lsregister command needed for the rebuild has changed in 10.5. As such, the following command rebuilds the database on Leopard: [robg adds: If you find this happening a lot on your machine, you'll probably find it much simpler to put an alias in your .profile file. You need to create the file in your user's home directory (in Terminal), and a simple way to do that is by typing pico .profile. Then type alias lsrebuild='' into the editor window. Position the cursor between the quotes, paste in the line above, and then save and quit by typing Control-X, Y (to save changes), and pressing Return. Open a new window, and you'll be able to just type lsrebuild to rebuild the database. Feel free to change lsrebuild to whatever name you'd like to use.]
  • Currently 3.50 / 5
  You rated: 4 / 5 (10 votes cast)

10.5: Rebuild the launchservices database | 5 comments | Create New Account
Click here to return to the '10.5: Rebuild the launchservices database' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Rebuild the launchservices database
Authored by: on Nov 15, '07 08:14:52AM

It appears that these ghost entries are just copies of your applications in your Time Machine Backup. Great hint, it will help a lot before Apple resolves this issue.

[ Reply to This | # ]
10.5: Rebuild the launchservices database
Authored by: fds on Nov 15, '07 08:40:18AM

"now and then" happens when you browse to the Time Machine backup of your applications.
So avoid looking at /Applications in Time Machine if you want to avoid having to rebuild your LS database.

[ Reply to This | # ]
TinkerTool System got the job done
Authored by: alec kinnear on Jun 08, '08 05:45:50AM

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 -

[ Reply to This | # ]
Try this script instead!
Authored by: ortho on Jan 01, '09 09:58:50AM

I noticed that Ccktail also has the ability to rebuild launch services in Leopard, but I saw this hint posted by "ayemac" on the Apple forums where you create an app in Script Editor that does the whole shebang for you.... just doubleclick and go:

display dialog "The Finder must quit and will relaunch after the Launch Services rebuild is complete. The rebuild may take several minutes, during which time you should refrain from using any other apps." buttons {"Cancel", "Rebuild LS Database"} default button 2 with icon caution
ignoring application responses
tell application "Finder"
delay 2
end tell
end ignoring
delay 5
tell application "System Events" to set running_applications_ to get name of every application process
if running_applications_ contains "Finder" then do shell script "killall Finder"
do shell script "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user"
tell application "Finder"
delay 2
end tell
tell me to activate
display dialog "The Launch Services rebuild is now complete." buttons {"OK"} default button 1 with icon note

Paste the above into (between the delimiters) "Script Editor" and then do a File->Save As. Specify a "File Format" of "Application" and place it somewhere - e.g. Desktop, and run it.

I tried it and it worked for me. I don't think you even have to restart the finder this way, though i could be mistaken about that. I suppose you could probably delete the dialog boxes and stuff if you wanted.

[ Reply to This | # ]
script link
Authored by: ortho on Jan 01, '09 10:00:34AM
sorry, here's the link to the forum post where i found the script:

[ Reply to This | # ]