Pages

Tuesday, October 08, 2013

Unable to remove or disconnect network drive

 

When trying to disconnect a network drive the following error message is presented

“This network connection does not exist"

or

"Z:\ refers to a location that is unavailable. It could be on a hard drive on this computer, or on a network. Check to make sure that the disk is properly inserted, or that you are connected to the Internet or your network, and then try again. If it still cannot be located, the information might have been moved to a different location.”

Perform the following steps to correct:

Run->Start
Regedit

Navigate to
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints
In this folder, delete anything with ## in front of it.

Run Task Manager
On Processes tab, highlight Explorer and click End Process
File->New Task (Run…) and type
Explorer

Below is a possible script to automatically fix the registry.  Save the following as .vbs

identify subkeys with "##" and remove them

const HKEY_CURRENT_USER = &H80000001
strComputer = "."
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2"
oReg.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubKeys
 
For Each subkey In arrSubKeys
    If CBool(Instr(subkey,"##")) Then
        oReg.DeleteKey HKEY_CURRENT_USER, strKeyPath&"\"&subkey
    End If
Next

No comments: