If your Mac presents small filesystem problems like incorrect icons for documents or displaying deleted applications on your “Open With” menus, you can rebuild OS X’s LaunchServices database to correct them.

To rebuild LaunchServices on Mac OS X 10.4.* (Tiger):

Open a new Terminal window and enter the command below, then wait a few seconds for the processing to finish:

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

To rebuild LaunchServices on Mac OS X 10.5.* (Leopard):

Open a new Terminal window and enter the command below, then wait a few seconds for the processing to finish:

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

Other lsregister Options:

The lsregister utility used in the above commands has several other parameters; if you enter:

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

…you’ll be presented with an explanation of all the available options:

lsregister: [OPTIONS] [  < path >... ]
                      [ -apps [,domain]... ]
                      [ -libs [,domain]... ]
                      [ -all  [,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
Share this article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Twitter
  • GatorPeeps
  • Digg
  • Reddit
  • muti.co.za
  • DZone
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Ma.gnolia
  • Slashdot

Related posts:

  1. Resetting the contextual ‘Open With’ menu in Mac OS X
  2. Exporting your iPhone’s SMS Message Database to a CSV file
  3. Mac OS X / UNIX Quick Tip: Find and kill frozen processes
  4. A Python script to check Google rankings for a specific domain and search term
  5. Changing the default MySQL root (or other user) password