Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Some digging around suggests that this is a common-ish problem, but instead of workarounds, I'd like to see if there is a way to fix this once and for all. Having to restart the shell to get basic functionality working is unacceptable in an enterprise-grade operating system!

A reproduction on a cleanly installed Windows 7 Enterprise X64 machine is as follows:

  1. Connect to an SMB share anywhere on your network
  2. Map it as a drive, selecting "reconnect at login"
  3. Disconnect the share via the context menu

The icon remains in Explorer. Attempting to disconnect it again results in an error saying the network location cannot be accessed.. You have to either reboot or kill/restart Explorer to get the "ghost" drive letter to vanish and become available to reuse.

I'd like to make this problem go away for my users, so that if they drop the drive for whatever reason, they can reuse the letter without delay, and without killing their explorer session or requiring a reboot.

I guess this is a two-part question.. First, is this possible, and if so, where would I look? I don't think there's a way to hook into the "drive disconnected" event off the top of my head, at least not without writing drivers.

share|improve this question
    
What does net use say when the drive is disconnected but Explorer still has the ghost? –  ckhan Apr 30 '13 at 3:53
    
Nothing, it acts as though the drive is not connected. –  Mikey T.K. Apr 30 '13 at 12:26

2 Answers 2

Well, the drive letter is still clearly mapped and if getting rid of that is what you're trying to do, you could jump in the command prompt and go (where x: is the drive letter)

net use x: /delete

This should get rid of it. When you're disconnecting the share in the context menu, it should be unmapping it as well but I've seen this disconnect between the GUI and what Windows is actually doing. The above can be easily scripted for your users, and with a bit of VBscript you could potentially have them enter in the Drive letter they wish to have disconnected.

This is not ideal but I know I've seen some weirdness with Windows hanging onto Drive letters even though they should have been unmapped.

share|improve this answer
    
No good - the NET USE list is empty after doing the context menu disconnect, the ghost drive is still there, and it won't let me remap the letter to something else. –  Mikey T.K. Apr 30 '13 at 12:24
    
How do you map the drives in the first place? By script, command, group policy? Let's see if we can't track down what's going on here. –  Will.Beninger Apr 30 '13 at 19:46
    
In this case, just by going through Explorer. Plugging in a UNC location, and then clicking "Map network drive" on the top bar. –  Mikey T.K. May 13 at 16:40

Restart the "explorer.exe" process;

  1. Right-click on the taskbar and select "Start Task Manager"
  2. Go to the "processes" tab
  3. find and end the "explorer.exe" task, dont close the task manager yet, your task bar should disappear
  4. Click on "File" and select "New Task (Run...)"
  5. Type in "explorer" without quotes and click "OK", the taskbar should return

Open "My Computer" or "Computer" again and the stuck mapped drive should now be gone.

share|improve this answer
    
Welcome to Superuser :) - This workaround was mentioned in the question, and doesn't really solve the problem of drives hanging around after they've been explicitly disconnected. –  Mikey T.K. Dec 4 at 20:41
    
Hmm this worked for me. Another thing I might have done is renamed the drive letters for the mapped drives. If the drive letters could conceivably be used by thumb drives, or other more transient devices, they might stick around. After mapping some drives near the end of the alphabet my stubborn "stuck" drives went away. For example my company uses the "G" drive which is close to the amount of physical devices I might have connected up at any given time. I changed it to the "M" drive and used the steps above, the problem is gone for me. –  Johnny5 Dec 18 at 0:03

Your Answer

 
discard

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.