How to close open SAMBA / Windows Shared Folder connections effectively

Since the concept of mounting a file system had risen, nearly every type of media and storage device can be accessed from practically everywhere in the world. Unix / Linux based systems are exceptionally good at handling multiple connections to the same host with different user / pass login credentials. But how does this look like under Windows XP or Windows 7?

The answer is simple: by default, there can be only one open connection to the host! In an environment where for instance you need to test the permissions of different users to the same server, it can truly be a pain in the ass to keep on logging in and out (not to mention rebooting…)! For what its’ worth, there is a neat little trick that can be applied in the command line:

First, let’s check the currently open connections, hit WinKey + R, type in cmd and hit the Enter key, then issue the following command:

 

net use

 

It will print those connections that are active and are held open. To shut them down and close them for good, You will need to exit every Explorer / Total Commander instance in which the shared folder is open. After that, use this command:

 

net use \\remotepc\shared_folder /d

 

This will force drop the connection, and after a few seconds if you hit up your shared folder again, it will now ask for you password (if you did not checked the box to save your password beforehand)

Source is Here

About the author

Gábor Hargitai

View all posts

Leave a Reply