Apple - How do I disable this message: "the disk was not ejected properly"?

Much better to do this:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.UserNotificationCenter.plist

Which will just stop the UserNotificationCenter service from running, leaving your system files intact!

beware: as noted in the comments, this will disable all system notifications, including those when programs request access to system services like contacts


This applescript will close them for you. Paste it into Script Editor and then Save as an application. Then grant access to that application in (System Preferences > Security & Privacy > Accessibility) Then you can use an application like ControlPlane https://www.controlplaneapp.com/ to run the application on wake thus closing them all automatically! ** Note: You will need to grant Accessibility access to ControlPlane as well.

tell application "System Events"
tell process "NotificationCenter"
    set numwins to (count windows)
    repeat with i from numwins to 1 by -1
        tell window i
            set temp to value of static text 1
        end tell
        if temp contains "Disk Not Ejected Properly" then
            click button "Close" of window i
        end if
    end repeat
end tell
end tell

Certainly not an elegant answer but, you can disable UserNotificationCenter.app found in /system/library/coreservices - replace it with another app or file with the same name. It will stop any warnings popping up (including that your drive is full) so watch out for that, but in my experience it does what you are looking for.

I actually did this to my mac a long time ago, and forgot about it until you asked you question. Credit to Macpadawon at http://macosx.com/forums/mac-os-x-system-mac-software/297194-disable-device-removal-message.html for the answer - same place I found my answer a couple of years back.