If you have a computer that runs Windows, chances are you have at least one mapped drive. This is a drive that is assigned to your name and is visible in the Windows Explorer. If you don’t have a mapped drive, your computer will try to find one for you automatically. If your computer can’t find a mapped drive, it will ask you for help. To disconnect a non-mapped UNC path drive in Windows, follow these steps:

  1. Open the Windows Explorer and navigate to the location where you want to disconnect the drive. For example, if you want to disconnect the C: drive on your desktop, open Explorer and navigate to C:\Windows\system32\drivers.\DISKPART\CMDLINE_MOUNT\DRIVERS\diskpart.exe .
  2. In the DiskPart window, click on the Connect button and provide your name and password for the DISKPART service. The DISKPART service will connect to the remote UNC path drive and start listing devices in order from their leftmost device until it finds an available disk space on that remote UNC path drive. You can see which devices are connected by looking at their names in the DiskPart window’s list of connected devices (if they are listed at all). If there are no devices listed on the remote UNC pathdrive after trying several times to connect with DiskPart, then it’s likely that there isn’t any disk space available on that remote UNC pathdrive for connecting disks!
  3. To disconnect a non-mapped UNC pathdrive from Windows using DiskPart: 1) In DiskPart, click on Connect . 2) Type your name and password for DISKPART service into the Connect dialog box (you’ll need them both if you’re using an Administrator account). 3) Click on Disconnect . 4) The disconnected non-mapped UNCpathdrive will be listed in DiskPart as an available disk space device!

Really confused as to what I’m talking about? Let’s walk through the process. First, imagine that you browse through and connect to a share, entering your username and password to gain access.

The problem is that you stay connected, and there’s no visible way to disconnect yourself. If you try and shut down the other PC, you’ll receive a message that users are still connected. So let’s disconnect!

Open up a command prompt, and then type in the following:

This will give you a list of the connected drives, including the ones that aren’t actually mapped to a drive letter. To disconnect one of the connections, you can use the following command:

For example, in this instance we’d disconnect like so:

Now when you run the “net use” command again, you’ll see that you’ve been properly disconnected.

If you wanted to actually connect to a share without mapping a drive letter, you can do the following:

You could then just pop \server\sharename into a Windows Explorer window and browse the files that way. Note that this technique should work exactly the same in any version of windows.