Link to home
Start Free TrialLog in
Avatar of Vas
VasFlag for United States of America

asked on

Windows 10 - How to disconnect mapped network drives

I have a NAS, and in Windows 10 I have a couple of mapped drive set up to connect to the shares on the NAS.

I don't save the login when I authenticate to connect (cause, ransomeware), so after each reboot I just click on my mapped drive and login.

I want to be able to disconnect the mapped drives once I'm done moving files. But other than rebooting I haven't found a way that actually disconnects the drives.

The odd thing is that the command "net use" doesn't show any connections (even though I am connected and can browse my content on the share)

I tried this command (the mapped drive share is drive letter T:/ ) and it says it was successful but I can still use the share:

C:\>Net use t: /delete
t: was deleted successfully.



What command(s) should I be using to log out of these shares. I don't want to delete the drive mapping, just log out.


Thanks
Avatar of awawada
awawada

This is a normal behavior. If you are informed that the mapped drive was deleted successfully, it will not disappear immediately and you will see it being "available" in Windows Explorer. It will go away only after you reboot your computer or log off from your user account and log back.

Can you try these commands (one after one):

net use * /d and
taskkill /f /IM explorer.exe
explorer.exe
after Net use t: /delete and check if you are still connected?

Is you NAS a backup?
Avatar of Edward Pamias
Or you can go to Windows Explorer, click on This PC, go to the Ribbon, select drive tools, you should be able to disconnect the drive from there.
Avatar of Vas

ASKER

My NAS is a Synology, yes I mostly use it for backup and some other things.

Ok so about the guidance so far..

Edward - I was able to disconnect that way, but could not easily reconnect. I had to map the network drive again (even though the mapped drive still showed in My PC), I mapped it to the same drive letter and it connected.

So that actually shows me that I don't want to simply disconnect - when I remapped it, it didn't ask again for authentication. This means malware/ransomware may be able to re-map this drive.


So maybe what I really need to accomplish is LOGGING OUT of the mapped drive, rather than disconnecting or removing it?


awawada - your first command had no results. I didn't try your other commands I'm looking for a way not to disrupt everything else I have open on my PC.
I would create a script and run this to simply disconnect

@echo off
Net use t: /delete
net use * /d
taskkill /f /IM explorer.exe
explorer.exe 

Open in new window

Script_for_you.zip
ASKER CERTIFIED SOLUTION
Avatar of ivan rosa
ivan rosa
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Vas

ASKER

Ivan Rosa's solution is the one that works best, I'd like to mark his as the best answer please.
Avatar of Vas

ASKER

ivan rosa's answer is the best solution, I'd like to mark that one as the answer please.
@Vas.... I did mention that as well in my post above. Just an FYI. :)
Avatar of Vas

ASKER

Hi Edward, for some reason I couldn't follow the steps as you posted them on my system. Thanks though, maybe it will work for someone else.
Sorry, I just type Windows Explorer on the run line and it comes up. Sorry I was not clearer in my instructions.
If I may ask, how did you get to "This PC" with no further instructions?
I see where I made my error I said "Drive Tools" not tools.