How do I REMOVE a Network Drive [and the horse it rode in on]


  1. Posts : 730
    Windows XP Pro SP3, Windows 7 Pro 32-bit, Windows 7 Ultimate 64bit, Windows XP Home SP3
       #1

    How do I REMOVE a Network Drive [and the horse it rode in on]


    how?
    when I right click this failed network drive experiment, explorer hangs. when I surface the tools menu, I get no "unmount the network drive" ability.

    somebody pls shoot this thing!

    win7 ultmate x64

    I don't want to merely disconnect [which gives an error: network connection does not exist] but to eradicate.

    thanks
    z
      My Computer


  2. Posts : 5,605
    Originally Win 7 Hm Prem x64 Ver 6.1.7600 Build 7601-SP1 | Upgraded to Windows 10 December 14, 2019
       #2
      My Computer


  3. Posts : 730
    Windows XP Pro SP3, Windows 7 Pro 32-bit, Windows 7 Ultimate 64bit, Windows XP Home SP3
    Thread Starter
       #3

    the reg downloads were of interest. added that, but see nothing that it adds to the picture. no right-click context menu to help, no entry in the explorer tools menu.
    not really sure what it did...

    I may be too dense to understand the tutorial, but it appears to be only dealing with whether or not the tool/option is available to users or not, and does not deal with my issue at all. on ultimate x64, why would one need to add/subtract any options from the available? if one can 'add' a network drive location, it would seem one should be able to remove the same? what am I missing?

    Anak said:
      My Computer


  4. Posts : 730
    Windows XP Pro SP3, Windows 7 Pro 32-bit, Windows 7 Ultimate 64bit, Windows XP Home SP3
    Thread Starter
       #4

    i've read a bunch of googled help things, but none seem to deal correctly with the situation of a previously-mapped network location that has become non-functional. in this case the use of "net use" variants are of no use because the assumption is that if one has a network drive, it will show up in the net use list, and that's not true, apparently, for win7. I have the z: drive mapped, and the system vainly tries to reconnect it at every logon, and every time I right-click the rascal.
    example: Script to remove disconnected network drives
      My Computer


  5. Posts : 5,605
    Originally Win 7 Hm Prem x64 Ver 6.1.7600 Build 7601-SP1 | Upgraded to Windows 10 December 14, 2019
       #5

    No your not the dense one, yes I mis-read actual drive with drive options in context menu.

    Did you use an: Elevated Command Prompt when you tried the script?

    Is this the Script you used?
    Code:
    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
    Or these?
    Code:
    The following VBScript will enumerate all network drives, ping the  server extracted from each drive path, and removes the network drive if  server doesn't reply. Of course this script can only be used if Ping is  something that you can rely on.
     Set objNetwork = CreateObject("WScript.Network")  Set objDrives = objNetwork.EnumNetworkDrives  For i = 0 to objDrives.Count - 1 Step 2     DriveLetter = objDrives.Item(i)     DrivePath = objDrives.Item(i+1)     If Len(DriveLetter) > 0 Then         DriveServer = getServerFromPath(DrivePath)         If Not Ping(DriveServer) Then             objNetwork.RemoveNetworkDrive DriveLetter, True, True         End If     End If Next  Function getServerFromPath(txt) ' Function to extract server name from share path     strPattern = "[^\\][A-Za-z0-9.]+"     Set regEx = New RegExp     regEx.Pattern = strPattern     Set Matches = regEx.Execute(txt)     For Each Match in Matches         getServerFromPath = Match.Value     Next End Function  Function ping (host) ' Function that checks whether or not the specified computer replies to Ping   Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._     ExecQuery("select * from Win32_PingStatus where address = '"_         & host & "'")   For Each objStatus in objPing     If IsNull(objStatus.StatusCode) or objStatus.StatusCode<>0 Then         ping = FALSE     Else         ping = TRUE     End If   Next End Function
    I was going to offer this:
    Type/copy/paste, net use (drive letter): /delete in command prompt and hit enter.

       Note
    (drive letter): is the actual drive letter of the network drive, which you want to remove from your computer.
    but it looks like you may have already tried that.

    I see there is also this one: NET USE * /DELETE /Y
    You may end up having to remove all of the drives, and then remapping the one(s) you want.

    I have to leave for an appointment, I will check back later...
    Last edited by Anak; 06 Feb 2012 at 16:49. Reason: Typo
      My Computer


  6. Posts : 730
    Windows XP Pro SP3, Windows 7 Pro 32-bit, Windows 7 Ultimate 64bit, Windows XP Home SP3
    Thread Starter
       #6

    well, I got it done - it was crude, I admit, but worked. one of those tutorial/message/thread thingies gave me the idea of just going into the registry and finding the mount points, manually delete the key & subs. it worked.

    I wonder at the rationale of MS leaving such a predicament - its not like mapping/unmapping is "esoteric" :)
      My Computer


  7. Posts : 5,605
    Originally Win 7 Hm Prem x64 Ver 6.1.7600 Build 7601-SP1 | Upgraded to Windows 10 December 14, 2019
       #7

    That is great news! I am glad you were able to get it straightened out.

    It sounds like you opened regedit and searched for
    Code:
    HKEY_CURRENT_USER\Software\Microsoft\windows\CurrentVersion\Explorer\Mountpoint key
    And, in that Mountpoint key found the drive you needed removed and deleted it.

    I did see that registry modification elsewhere, but did not have the time to post it.
    There must be a dozen different ways to try, and unmap or delete a drive.

    If you can confirm what you did by using the registry key in the code box or another you could mark this thread solved, it will help other members.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:10.
Find Us