6

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.

2
  • What does net use say when the drive is disconnected but Explorer still has the ghost?
    – ckhan
    Apr 30, 2013 at 3:53
  • Nothing, it acts as though the drive is not connected.
    – Karu
    Apr 30, 2013 at 12:26

5 Answers 5

4

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.

3
  • 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.
    – Karu
    Dec 4, 2014 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, 2014 at 0:03
  • Yep, fixed it for me too. Imagine you still have to kill the windows explorer to fix things like this in 2020. :(
    – Dokbua
    May 5, 2020 at 10:37
4

According to this site user Zach H's method, I went to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\ ,right-click on the drive mapping key (the "ghost" drive, if Z: is mapped to \\Server\folder then it would appear as ##Server#folder), deleted it ,and then restarted explorer.exe and the disconnected drive disappeared.

This solution still needs restarting explorer session ONCE. After that, disconnecting the share via the context menu the icon would disappear in Explorer.

1

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.

3
  • 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.
    – Karu
    Apr 30, 2013 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
    Apr 30, 2013 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.
    – Karu
    May 13, 2014 at 16:40
0

Restarting the explorer.exe process usually fixes this for me.

Alternatively, remove the registry key as w10 said, and then restart the explorer.exe process.

-1

https://support.microsoft.com/en-us/kb/932463

Use that article to delete the drive from the registry. I had the same issue but once I deleted the registry entry for it and remapped it I was good.

2
  • 1
    Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.
    – DavidPostill
    Jul 7, 2016 at 7:48
  • This solution just deletes the registry data as w10 mentioned above.
    – Rob
    Mar 5, 2020 at 18:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .