Terminal command to rebuild launch services database?

Anyone know the exact terminal command to rebuild the launch services database for Mavericks?

You MUST recopy the code above as there are (SPACES) that Terminal will not accept.  e.g.
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user ; killall Dock
Notice, 1st line 'LaunchSe' is cut off...this will show up as a blank space when copy/paste.  Edit this prior to using it in terminal otherwise it could become very frustrating.
Hope this helps it did for me once I did it correctly

Similar Messages

  • Rebuild launch services database in Lion problem

    Everytime that i restart the computer (MacBookPro 17" latest model) the "launch services database" in Lion get spoiled and i have to rebuilt it again. Does not happen when login/out. Any idea what the problem could be or if it is a seriuos one. The computer seems to run OK

    1-  I have to rebuild "launch services data base" for every account every time that i restart the computer, except the guest account because the "launch services data base" is not spoiled !
    2-  For example see the installer .pkg icons (has not been rebuilt "launch services data base") in the administrator account and same pkg when i switch to the guest account (here the "launch services data base" is not spoiled), why? :
    anybody any clue? look at these pictures :

  • Rebuild Launch Services Database

    I'm about to connect a SuperDuper clone of my Tiger installation to my fresh, clean install of Leopard. I'm worried that when I open the Applications folder on my Tiger clone, the LaunchServices database will be populated with all of these applications that I never intend to use.
    How do I reset/rebuild the LaunchServices database in Leopard, I cannot locate 'lsregister' -- is there a new method, or have things changed in Leopard?
    Alternatively/also, is there a way to tell launch services NOT to scan external volumes, or a specific directory?
    Thanks everyone for your help!

    What do you mean by 'removing it'?
    I hope you don't mean the 'lsregister' file?
    The command to run (adapted for Leopard from other posts I've seen) is:
    "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fra mework/Support/lsregister -kill -r -domain local -domain system -domain user"
    without the quotes. I think Finder needs to be restarted to see the effect there.
    Better still, here's an adapted AppleScript I got from a post:
    BEGIN__SCRIPT
    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
    quit
    end tell
    end ignoring
    delay 5
    tell application "System Events" to set runningapplications to get name of every application process
    if runningapplications contains "Finder" then do shell script "killall Finder"
    do shell script "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fr amework/Support/lsregister -kill -r -domain local -domain system -domain user"
    tell application "Finder"
    delay 2
    activate
    end tell
    tell me to activate
    display dialog "The Launch Services rebuild is now complete." buttons {"OK"} default button 1 with icon note
    END_SCRIPT
    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.

  • Repairing Launch Services Database

    I had a problem embedding an html e-mail in Apple Mail. Safari could not locate Apple Mail. The default e-mail reader was set to Mail. But when I reselect it worked fine.
    V.K. suggested that the launch services database was the problem. Is it something that needs repairing and if so, how does one repair it?
    Will this also fix the problem I have with EPS files not opening up in the correct parent application (Photoshop versus Illustrator)?

    I think I told you that you were fine in the other thread.
    you can rebuild launch services database using the following terminal command
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    but it will not change the default application set to open a certain file type. to do that select and eps file and enter command+i. in the resulting popup go to the "open with" section and select the application you want to open it with. then click "change all".

  • Launch Services Database rebuilding at restart

    Well as it says in the title, with every restart of my machine, the computer is rebuilding the launch services database.
    I am not sure — if it's actually rebuilding the database; but every time I restart and open a python script for e.g. — it opens a dialogue box point to the first ever launch of "Sublime Text". Same with Textmate or any other software.
    For some files, it forgets the application associated with it. For e.g. sometime back I set Sublime Text to open files without any extension. That doesn't happen anymore.
    I am currently running 10.8.2.

    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -Rh $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    The first step should give you usable permissions in your home folder. This step will restore special attributes set by OS X on some user folders to protect them from unintended deletion or renaming. You can skip this step if you don't consider that protection to be necessary.
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • Rebuilding the Launch Services Database?

    If one rebuilds the Launch Services Database, can the System be Optimized immediately, or does one have to restart after rebuilding the LSD (then Optimize after the restart), for the rebuilt database to be included in the Optimization? Thanks.

    Great news, thanks.

  • Launch Services database?

    I have noticed recently that I have multiple listed applications when I am launching files from my desktop "open with" command. With a fresh bootup their is only 1 of each app. but as the day goes on I can have as much as 4 duplicates of each application which caused much confusion on which app to use to launch a file.
    I was told that this maybe due to the OS Launch Services database and to use Cocktail to correct this problem.
    Can anyone shed some light on this situation also?
    Thanks

    You can reset the Launch Services database as follows:
    Rebuild LaunchServices Database
    For Tiger users
    Open the Terminal application in your Utilities folder. At the prompt paste in the following command in its entirety:
    /System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServic es.framework/Support/lsregister -kill -r -domain local -domain system -domain user
    Press RETURN.
    For Leopard users
    Open the Terminal application in your Utilities folder. At the prompt paste in the following command in its entirety:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    Press RETURN.

  • Are there any Apps to manage OS X's Launch Services Database?

    I should like to remove some entries within the "Open With" menu, and prevent further automated additions or re-additions.
    I know how to reset the database, but that is insufficient to prevent additions from apps on drives connected or networked at a later time.
    Help appreciated.

    You could install BootCamp which does "resize" slightly, then erase or convert the resulting Windows partition.
    One reason to do so is to have a small "emergency OS X" volume, similar to MicroMat TTPro's "eDrive" when you have just one hard drive and on the road and no FW drive handy.
    Another reason to partition is to keep the boot volume from being cluttered with music and video files or such. I have a lot of large DMG files that I prefer to keep elsewhere.

  • Multiple entries in 'Open Width'using the above terminal command

    /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fram ework/Support/lsregister -kill -r -domain local -domain system -domain user
    I tried using the above terminal command to reset launch services but it does not seem to work. I still have multiple entries. What am I doing wrong?

    You may have to clarify. Multiple entries in Open With can be normal. For example if you have multiple versions of an application for whatever reason, they will all show. Plus, any applications that report being able to open a file type will show (had an annoyingly long list for text files on my old machine as some apps that didn't even handle documents such as games reported being able to open them).

  • Open With menu won't clean up with Terminal command

    After upgrading to 10.6 last month I can't clean up my open with menu. I ran the following in Terminal and it did nothing to clean up the duplicates:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchS ervices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    I used to run the following in Tiger and it never failed to clean up the duplicates:
    /System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServic es.framework/Support/lsregister -kill -r -domain local -domain system -domain user
    Must I delete “com.apple.LaunchServices” file located in Home/Library/Preferences
    OR
    Remove launch services preference files, "com.apple.LaunchServices.plist" and "com.apple.LaunchServices.QuarantineEvents" in /username/Library/Preferences/ folder and then run the commands to clear and rebuild the launch services?

    Thanks Andy. Running the following in Terminal cleaned up your problem with the Open With menus?
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    In December cnet.com wrote about running that command: "It gave only temporary relief to people dealing with sluggish Save and Save as menus." Using Onyx to clear caches and reset launch services was suggested instead. In October and March cnet.com wrote about rebuilding launch services to stop Finder caused crashes in Snow Leopard by trashing the launchservices preference files from user/library and then running the following in Terminal (custom file associations will revert back to default):
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -seed -rfv -all user, system, local
    When I was still running Tiger last year and had a Launch Services problem caused by crashes in the Finder due to misplaced folder aliases, BD Aqua in this forum linked me to The X Lab @
    http://www.thexlab.com/faqs/resetlaunchservices.html#Anchor-Reset-47857
    where I learned all I needed to do to straighten things out was delete the following cache files from HD/Library/Caches:
    com.apple.LaunchServices-0140.csstore
    com.apple.LaunchServices-014nnn.csstore
    The information about resetting Launch Services at the X Lab stops with Leopard. There are no cache files in Snow Leopard like those from Tiger above and their equivalents in Leopard.

  • That Launch Services thing again?

    OK folks. Please help if you know....all of a sudden my textedit won't open an RTF document or txt document when I double click on it. If I go "Open With" (right click say), then no problem.
    I've read all the forums so:
    1) I've copy/pasted various scripts (involving kill lsregister things) to use in the Terminal...reboot
    2) I've used Onyx and Yasu to reset the Launch Services database....reboot
    3) I've trashed the LaunchServices caches in the Library/Caches plus the LaunchServices plists...reboot
    Each time, the issue is fixed. Then after some time (say half an hour) I retry to open an rtf and bingo, tries to open but nothing happens. Repeat any of 1 to 3 above, temp fix, then....
    Any ideas any ideas? (Save complete reinstall????)
    Message was edited by: Chris Marshall3

    The reason why is that the cache files when they are deleted by a program like Onyx are being written to at exactly the same moment they are being deleted. This results in left over corrupt files which rebuild themselves as corrupt files in an endless loop every other reboot. One thing that may help is to remove issues which cause the disk to be too full*:
    http://www.macmaps.com/diskfull.html
    - * Links to my pages may give me compensation.

  • Launch Sevices Database

    Hey Peoples,
    Does anyone know how to restore one's "Launch Services Database". I believe I've wiped mine clean, as when I double click on files I'm prompted with "You are opening this application for the first time", on programs I've used for years.
    Much thanks,
    Jackson

    From http://developer.apple.com/carbon/tipsandtricks.html
    From the "Terminal" application:
    cd ~/Library/Preferences/
    rm LS*
    rm .LS*
    Then log out and log back in.

  • Launch Services crashing - AFP, SMB, NTFS, exFAT, FAT32 all unmountable

    My Mac Pro was working fine until this month hit... first I noticed that I could no longer mount my network shares (AFP and SMB shares on a Drobo 5n). My first assumption was that there was something wrong with my shares, but that's not the case as every other computer and device I have has no issues connecting and mounting the shares. Not only that, but my Windows partition on this Mac Pro connects fine as well. That's when I noticed my Windows partitions were no longer mountable in OS X either. So I ran some tests with a flash drive in disk utility, after formatting the drive in exFAT, FAT32 or NTFS the flash drive is no longer mountable... HFS still mounts of course, but not anything else.
    So at this point, I've got AFP, SMB, NTFS, exFAT and FAT32 all completely unsuable in OS X. Pretty messed up.
    Taking a look at console shows the same messages over and over again:
    5/3/13 11:49:30.314 PM ReportCrash[11888]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
    5/3/13 11:49:30.314 PM ReportCrash[11888]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
    5/3/13 11:49:30.314 PM ReportCrash[11888]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
    5/3/13 11:49:30.314 PM ReportCrash[11888]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
    5/3/13 11:49:30.314 PM ReportCrash[11888]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
    5/3/13 11:49:30.314 PM ReportCrash[11888]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
    5/3/13 11:49:30.314 PM ReportCrash[11888]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
    5/3/13 11:49:30.314 PM ReportCrash[11888]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
    5/3/13 11:49:30.314 PM ReportCrash[11888]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
    5/3/13 11:49:30.314 PM ReportCrash[11888]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
    5/3/13 11:49:30.328 PM com.apple.kextcache[11922]: Child process /usr/sbin/kextcache[11923] exited due to signal 6.
    5/3/13 11:49:30.328 PM com.apple.kextcache[11922]: Error 107 rebuilding /System/Library/Caches/com.apple.kext.caches/Startup/kernelcache.
    5/3/13 11:49:30.329 PM com.apple.kextd[11869]: kextcache error while updating / (error count: 10)
    5/3/13 11:49:30.329 PM com.apple.kextd[11869]: async child pid 11922 exited with status 6
    5/3/13 11:49:30.362 PM ReportCrash[11888]: Saved crash report for kextcache[11923] version 268.12 to /Library/Logs/DiagnosticReports/kextcache_2013-05-03-234930_LaBonty.crash
    I've tried literally everything I can think of... clearing caches, repairing disk permissions, rebuilding launch services, rebuilding spotlight, rebuilding the kext cache, running maintence scripts, etc. etc.... nothing has helped.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Post for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. You won't be able to mount network shares, but a flash drive should mount. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Launch Services - Resetting Generator Caches.

    I'm seeing a lot of messages in my system.log file that look like this:
    Safari[15135]: [QL] Launch Services Database change notification (com.apple.LaunchServices.DatabaseChange). Resetting Generator caches.Finder[167]: [QL] Launch Services Database change notification (com.apple.LaunchServices.DatabaseChange). Resetting Generator caches.System Preferences[15180]: [QL] Launch Services Database change notification (com.apple.LaunchServices.DatabaseChange). Resetting Generator caches.
    I see a block of these messages every 5 seconds. I tried googling around but can't seem to find any information about it. Has anyone else seen this? Should I be concerned about it?
    Thanks.

    I'm wondering if this has something to do with a broken spotlight index. I manually deleted my spotlight index from single user boot, and now I'm getting this message hundreds of times as spotlight reindexes my HD. I wonder if some glitch in spotlight causes various *.qlgenerator plugins to be repeatedly found, and thus causes quicklook to reload them over and over again...?
    It is just a theory.

  • Command that Works in Terminal Not Running as Launch Agent

    Trying to run the following command as a Launch Agent (OS X 10.7):
    /usr/bin/find /Users/username/Documents/Dropbox/Public -type f -mtime +2 -print0 | xargs -0 rm -r
    Created a plist file (reproduced below) and saved to ~/Library/Launch Agents, but the command isn't executed either at the specified time or when the agent is loaded via launchctl.
    If I change the command to a simple Applescript test:
    osascript -e 'tell Application "Finder" to display dialog "hello"'
    It runs correctly as a launch agent when loaded and as the specified time
    Which means there's something wrong with the first command (find). But the command runs as written when executed manually in the terminal.
    Suggestions? Thanks.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Label</key>
              <string>com.username.clean_dropbox</string>
              <key>ProgramArguments</key>
              <array>
                        <string>/usr/bin/find</string>
                        <string>/Users/username/Documents/Dropbox/Public</string>
                        <string>-type</string>
                        <string>f</string>
                        <string>-mtime</string>
                        <string>+2</string>
                        <string>-print0</string>
                        <string>|</string>
                        <string>xargs</string>
                        <string>-0</string>
                        <string>rm</string>
                        <string>-r</string>
              </array>
              <key>RunAtLoad</key>
              <true/>
              <key>StartCalendarInterval</key>
              <dict>
                        <key>Hour</key>
                        <integer>17</integer>
                        <key>Minute</key>
                        <integer>45</integer>
              </dict>
    </dict>
    </plist>

    Since your pipe is essentially just passing the find matches to rm, you can achieve the same result using find's -delete switch:
    /usr/bin/find /Users/username/Documents/Dropbox/Public -type f -mtime +2 -delete

Maybe you are looking for

  • I can't restore my iphone.  when i plug it in, the phone recognizes that it is plugged into itunes, but itunes doesn't recognize it

    My iphone charges when I plug it into my computer, but itunes doesn't recognize that any device is attached (I have the latest version; a pc, not a mac; it's a Verizon iphone).  Also, the phone's info button (which should tell me the serial number) s

  • Getting Error in EntityManager getQueryBuilder()

    I am using CriteriaQuery. I am getting an error in the below line: QueryBuilder queryBuilder = em.getQueryBuilder(); (where em is EntityManager instance) Error: javax.el.ELException: javax.ejb.EJBException: EJB Exception: ; nested exception is:      

  • Links on the forum are broken

    Don't know if anyone else has noticed, but links on the forum seem to be broken. e.g. Google Is this some user specific setting that I've accidentally activated, or has the forum lost some functionality?

  • Can we change language of our ADD ON as per SAP b1 language

    Hello Expert     I want to change the language of our ADD_ON  as like SAP B1 .i want whenever sap b1 language change as per country that time our add_on should convert language as like SAP b1 language like(labels, Headings)    is it possible.please h

  • Server-side Service-Locator

    Hi, i have written a ServiceLocator for the web-tier. This Service-Locator uses a cash for the EJB-Homes to increase performance. Is it intelligent to write a ServiceLocator like this for the ejb-container? Makes a cash of EJB-Homes in the ejb-contai