Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I work in a windows environment with active directory. Just logging out doesn't disconnect (unbind) the network drives. I need something more forceful, and faster than shutting down and restarting. Because if my mac awakes in another network without connection to the windows shares it gives me the spinning beach ball of death.

share|improve this question
up vote 3 down vote accepted

Are these shares automounted?

You could use AppleScript, or even bash quite effectively to do this using a Log Out Hook (or running manually):

tell application "Finder"
    if ((count of disks) > 1) then
        set drives to disks
        repeat with drive in drives
            eject drive
        end repeat
    end if
end tell
share|improve this answer
Great! Works! Is there a parameter I can give to the 'eject' command so it auto-force-disconnects the drives? It asked unjustly for a force disconnect when I ran it. – Anton Sep 17 '10 at 18:37
@Anton: I'm not sure - there doesn't appear to be anything in Finder's AppleScript Dictionary about this and I've never had to force eject them. Sorry. – Chealion Sep 19 '10 at 5:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.