Thursday, November 19, 2015

The case of the disconnected network drive (that wasn't) who wouldn't go away

Recently I had an issue with some newly images servers having  a disconnected network drive left over on the machine.

When trying to disconnect it, it was throwing this error:
          "This network connection does not exist."

This network connection does not exist

I checked from the command prompt to see if net use could do anything with it, however it was not listed.  I tried opening the drive, and a list of files was displayed.  So in reality it wasn't disconnected after all.  I looked around on google for answers and came across a few possible registry keys that might have it:


I checked these for all users and in the main HKLM tree, but there was nothing showing this entry anywhere.  Next, I used netstat -ano |find "445" to see what file sharing connections were open, and at least traced it down to a server name.  The server was related to mcafee, which is what was in the folder content as well.  Digging around a bit found the exact folder that was mapped on the machine. Trying to search the registry again with the server name didn't yield any results.

After failing with all the suggested methods of getting rid of the drive, I decided to try to disconnect it using the SYSTEM context.  So, I scheduled a task to run: net use * /delete /y, and set it to run under the SYSTEM account.  This took care of the problem and the drive is no longer showing up.