Monday, October 20, 2014

Disconnect from an un-mapped "drive" in Windows

In Windows, you can connect to network shares in two ways. You can map a share with any authorized credentials so that this share will appear as a drive letter in Windows Explorer. This way, not only you have a convenient drive letter like Z to work with, but you have the option to have Windows reconnect to the same share after a restart of the computer. This method is recommended if you have a password protected Windows account.

Another way is to go to the share and authenticate every time. This will not create a drive letter for the share. When you log out or restart the computer, this authentication is flushed, necessitating the need to re-authenticate.

There are times when you want to disconnect all connections to all shares for both mapped and un-mapped shares. With mapped shares, it's easy. Simply right click on the share's drive and choose Disconnect. However, with un-mapped shares, there is no apparent icon to act upon. You have to go to the command line and issue the net use command. Of course, logging out and logging back in will also release this share. However, sometimes this is not an option.

By typing net use you will see what un-mapped shares Windows is connected to.

If you want to disconnect these shares, type in

 net use /delete \\server\sharename 

The "server" and "sharename" are different for each network.

The following website has all the info you need.

http://www.howtogeek.com/howto/16196/how-to-disconnect-non-mapped-unc-path-drives-in-windows/

If you want to run a command to disconnect all unmapped drives:

net use * /delete /yes

If you do not want to type, then you can insert this into a batch file. Simply running the batch file will execute the command.

No comments:

Post a Comment