Home > Mac administration, Mac OS X, Scripting > Disabling AirDrop from the command line

Disabling AirDrop from the command line

A new feature in 10.7 is AirDrop, a way to share files easily between machines that are on the same local network. Amazing-sounding as it is, there are some Mac environments where it makes sense to turn it off. See below the jump for how.

You can enable or disable AirDrop with the following defaults commands

Here’s how to turn AirDrop off:

defaults write com.apple.NetworkBrowser DisableAirDrop -bool YES

Here’s how to turn AirDrop back on:

defaults write com.apple.NetworkBrowser DisableAirDrop -bool NO

You’ll need to logout and log back in to see the changes.

I’ve also written a script that would set AirDrop to be disabled in the user template, which would disable AirDrop for all new users created after this point.


# Disables AirDrop in Mac OS X 10.7.x for new users by setting
# the ~/Library/Preferences/com.apple.NetworkBrowser.plist to
# include the key "DisableAirDrop" with a value of YES

defaults write /System/Library/User\ Template/English.lproj/Library/Preferences/com.apple.NetworkBrowser.plist DisableAirDrop -bool YES

The script above is also available from here.

Hat tip to Jared Nichols for figuring this out and sharing it on the Casper list.

  1. October 14, 2011 at 8:05 am

    Uhm… actually, you do *not* have to be on the same local network (just tested!).
    This is the “magic” of AirDrop!

    By the way, your have a very nice and interesting blog.
    Keep up the good way! 🙂

    • Matt
      September 10, 2012 at 3:42 am

      @Andrea… you do have to be on the same network. Otherwise you would have several million Airdrop machines shown in the Finder! 🙂

      @David… It works for me. Just double check your spelling. Try copy and paste the text from the article.

  2. David Noyb
    April 30, 2012 at 12:34 am

    Newbie here. want to Disable AirDrop with the mentioned command: “Here’s how to turn AirDrop off”:

    defaults write com.apple.NetworkBrowser DisableAirDrop -bool YES This does not work for me at all. am I entering it wrong? I am sharing someone else’s network and want to keep my Mac private and inclusive to me. When I type the above command I get the returned message:
    012-04-29 18:26:54.060 defaults[908:707] Unexpected argument -bool; leaving defaults unchanged.
    Davids-MacBook:~ david$

  3. IT
    November 5, 2012 at 6:59 am

    Just FYI, this doesn’t completely disable AirDrop on Mountain Lion. Tested on Mac OS X 10.8.2, if you right click on a file you can still choose Share > AirDrop.

  4. Lucky
    September 11, 2013 at 8:34 pm

    Confirmed this works on my 10.8.4 machines. To apply this System wide, run this command “sudo defaults write /Library/Preferences/com.apple.NetworkBrowser DisableAirDrop -bool YES”

    You don’t have to log out. Just open the Task Manager and relaunch Finder.

    I did not get an option to Share->AirDrop

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: