Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I make Windows 7 log off from a password-protected Samba network drive?

share|improve this question
up vote 16 down vote accepted

Open CMD, type NET USE X: /DELETE or NET USE \\SERVER\SHARENAME /DELETE

where X: is your drive and \\SERVER\SHARENAME your fully qualified share name.

Step by Step

  1. View all network connections:

    NET USE
    

    Example Output:

      Status                 Local       Remote            Network
    --------------------------------------------------------------------------------
    OK                                 \\name\IPC$       Microsoft Windows Network
    OK                                 \\name2\folder    Microsoft Windows Network
    
  2. Using the Remote name, we can disconnect using on of the following statements, depending on which one we want to disconnect from:

    net use \\name /delete
    

    OR

    net use \\name2\folder /delete
    

    Example Output: (given the above \\name\IPC being connected))

    Net use  \\name /delete
    \\name was deleted successfully.
    

Another way, to disconnect from every share is to execute net use * /delete. This will disconnect every Network share you're currently connected to. This is still quicker than logging off and back on.

If you want to create an icon to automatically disconnect all network shares (using a GUI method), you can do the following:

  1. Right-click on a blank area of the folder you want to add the shortcut to.
  2. Point to New->Shortcut and click.
  3. Type net use * /delete /y for the Command, then click Next.
  4. Give it a name, and click Finish.

You can also specify a certain network share, if known in advance, and use that one instead. Using the /y automatically select the yes option in the command.

share|improve this answer
1  
thanks, good answer...but is there a GUI way of doing the same? I am actually asking not for myself(I switched to linux ages ago) but for a friend of mine who is not too tech-savvy. Thanks again. – Alex N. Oct 31 '11 at 2:38
    
You can create it as an icon (shortcut) or right-clck the drive in My Compute and click Disconnect – Canadian Luke Oct 31 '11 at 14:39

open notepad:

@echo off
::Disconnect user
net use * /delete /y
msg * /time:5 "You have been successfully Disconnected"

Copy paste save as a bat (file Extention " *.bat ", create a shortcut edit the shortcut to an icon of your choosing...

upon double click, the command will be run and a gui popup box will say the message and go away in 5 seconds or wait 5 seconds till appearing...

we use this quite a bit at work :)

share|improve this answer
1  
This duplicates another answer and adds no new content. Please don't post an answer unless you actually have something new to contribute. – DavidPostill Mar 17 at 21:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .