An error occurred while connecting [drive] to [share]. The local device name is already in use

I map a network drive from a PC (workstation) to another PC (server), that is always on.

When my workstation sleeps and comes out of sleep, I get this error message:

An error occurred while connecting [drive] to [share]. The local device name is already in use. This connection has not been restored.

enter image description here

I get one of those for each explorer window I had open pointing to the network drive.

If I go click the network drive in My Computer, type G: in explorer or really do anything to access the network drive, everything works great again.

How can I avoid this happening?

Both PC's are Windows 8.


Solution 1:

I found that by starting the Computer Browser service, the drives came back:

net start "Computer Browser"

Another way to fix it is to go browse to \\server (to re-establish the connection), then the drives should work again.

Windows also disconnects server connections after a timeout. If you run this command, it should never drop idle server connections:

NET CONFIG SERVER /AUTODISCONNECT:-1

Another solution could be

Start > Run > type "gpedit.msc" (without quotes) click ok.

Local Computer Policy > Computer Configuration > Administrative Templates > System > Logon > Always wait for the network at computer startup and logon

set this to Enable then reboot.