5/27/2023 0 Comments Remove mapped drive registryKaren, have you been able to reproduce the problem with my additional remarks? In the problematic situation as I've described as well. Here you can select the network drive and click OK. Instead of directly disconnecting a dialog will pop up (the same as in Windows 7). Then use the option you've highlighted in your screenshot. View (either deselect or select a local drive). So without writing any code your easiest way to reproduce it is to open the command line and execure (replace X: by the driveĮdit: I just noticed, that you can reproduce that problem with the option you've pointed out in Windows 10 as well: Before you click the "Disconnect network drive" menu item make sure that no network drive letter is selected in that But I also mentioned net.exe which uses the official APIs as well. I've mentioned the official APIs that result in that problem. Maybe I should've pointed it out better: My intention is to disconnect the drive programmatically, i.e. It openes up a new dialog that allows to select and disconnect a network This option from my description "Tools > Disconnect network drive", which however is a different one, because the Tools menu is only available in Windows 7, Vista and XP. The option you're pointing out does indeed work correctly, but it's basically the same as right-clicking the drive and selectiong "Disconnect", and it doesn't solve the problem that the options I've listed have that problem. Is there any chance this could be solved by patching Windows? This applies to all Windows versions from XP to 10, 圆4 and x86. At the moment if you want to programmatically disconnect a persistent network drive that wasn't available during logon you'll end up with an orphaned I've discussed this problem with many experts already and there doesn't seem to be a workaround for this. Methods, this option will only show "This network connection does not exist." If the drive has already been disconnected using one of the other Notice: this only works if done in the first place. This works flawlessly! The network drive is disconnected and immediately removed. Right-click on the drive and choose "Disconnect". There is one way to remove the drive correctly in the first place: This shows that it's some kind of orphaned drive in some internal Explorer cache or object list that is not removed correctly. To solve this problem at this point the user has either to log off and on again or kill explorer.exe and run it again. For example after changing the drive letter of a DVD drive to the disconnected network drive letter the drive is still shown as a network drive in the Explorer but The drive letter can be used to be assigned to a local drive in the Disk Management dialog. If done so, the new path is mapped to it, but the old name/path remains in the Explorer. The drive letter can be used for a new network drive connection. Although the drive letter icon is shown in the Explorer it's not visible in any other software and not accessible through Windows API Some details that indicate that this is a bug and not feature: Disconnect dialog: Explorer main menu > Tools > Disconnect network drive (7/XP) or the submenu "Disconnect network drive" (10/8.1) while no drive is selected when the click is performedĪll of them result in the problem that the drive letter icon remains in the Explorer although the network drive has been disconnected. API: WNetCancelConnection2 or WNetDisconnectDialog1 Probably the easiest way to reproduce it is by command line: net use X: /delete The balloon message is the best indication that you've reproduced the steps correctly.Īt this point I'd like to remove that network drive using my software. A balloon message will tell "Could not reconnect all network drives", but the drive will still be visible in the Explorer (with a red cross). Now physically disconnect from the network folder (unplug the cable or shut down the target system)."Reconnect at logon") using the integrated/official "Map Network Drive" dialog. Create a persistent (!) network drive mapping (a.k.a.Initial situation (tested with Windows 10, 8.1, 7 and XP):
0 Comments
Leave a Reply. |