How To Unmap A Network Drive: The Complete IT Guide To Removing Persistent Connections

How To Unmap A Network Drive: The Complete IT Guide To Removing Persistent Connections

Guide to Resolve Windows 11 Mapped Drive Not Showing Up

To unmap a network drive on Windows, open File Explorer, right-click the mapped drive under This PC, and select Disconnect. For automated, stubborn, or script-based connections, you can execute the Command Prompt instruction net use Z: /delete (replacing Z with your specific drive letter) or run the PowerShell cmdlet Remove-SmbMapping -LocalPath Z:. These methods immediately terminate the Server Message Block (SMB) session and release the assigned drive letter back to the operating system pool.

Successfully managing network resources is a core operational requirement for system administrators, network engineers, and advanced desktop users. Over time, network architectures evolve, shared folders migrate to new storage area networks (SANs), and credentials expire. When these events occur, legacy mapped drives can degrade system boot times, cause application hangs, or trigger repeated credential prompts.

Knowing how to cleanly dismantle these connections prevents the system from polling inactive paths and maintains a pristine local directory structure.


System Assessment and Pre-Disconnection Planning

Before modifying your system's routing paths or active mount points, you must audit the existing configuration. Terminating an active mapped drive while a background service or running application is actively reading or writing to that drive can lead to local thread locks, application crashes, or data corruption.



Operational Audit Checklist



  • Operating System Compatibility: Verify target system parameters. Windows 11, Windows 10, Windows Server (2016 through 2022), and macOS (macOS Ventura and Sonoma) all handle mount points differently at the kernel level.
  • Required User Privileges: Standard user privileges are sufficient for user-level mappings. However, administrative rights are mandatory if the drive was mapped via an elevated token, dynamic startup script, or system-level service.
  • Time Allocation and Budget: This procedure requires zero financial expenditure and typically takes between one to five minutes of hands-on time, depending on the chosen interface (GUI, Command Line, PowerShell, or Registry Editor).
  • Active Session Scan: Open Task Manager or Activity Monitor to ensure no local applications (such as databases, IDEs, or backup engines) are running background processes pointing to the target network path.
  • Target Drive Letter Validation: Run a quick command-line query to match the exact logical drive letter (such as G:, M:, or Z:) with the corresponding Universal Naming Convention (UNC) path (such as \server\share).

Technical Protocols for Disconnecting Network Drives

The following sections provide the exact technical procedures required to unmap a network drive across multiple interfaces. Select the method that best aligns with your access level and administrative scope.



Method 1: The File Explorer Graphical User Interface (GUI)

The graphical user interface is the most direct path for end-users on standard workstations. It safely queries the shell to release the network mount without requiring command execution.



  1. Press the Windows Key + E on your keyboard simultaneously to open File Explorer.
  2. In the navigation pane on the left side of the window, scroll down and click on "This PC" to expose your local and network drives.
  3. Locate the "Network Locations" section in the main view pane.
  4. Identify the mapped network drive you want to remove. It will display a custom name followed by the network path and the assigned letter in parentheses.
  5. Right-click the target network drive to open the context menu.
  6. Click "Disconnect" from the drop-down menu options.
  7. Wait up to five seconds for the system shell to refresh. The drive icon will disappear from the list, confirming that the mount points and cached credentials have been unlinked.

Warning: If you receive an error stating "This network connection could not be found," the system shell is displaying a cached ghost icon. If this occurs, do not attempt the GUI method again; proceed directly to the Registry Purge method detailed below.



Method 2: Command Prompt Command-Line Interface (CLI)

For IT support staff, automation scripts, and situations where the Windows Explorer shell has frozen, using the command line is the fastest, most reliable manual process.



  1. Press the Windows Key, type "cmd" into the search bar, and select "Run as administrator" to ensure all processes have correct execution permissions.
  2. To view your active mapped network drives and confirm the exact drive letter, type net use and press Enter.
  3. Review the returned list. Note the drive letter in the "Local" column and the UNC path in the "Remote" column.
  4. To unmap a specific drive, type net use Z: /delete (where Z: is the letter of the drive you wish to disconnect) and press Enter.
  5. The system will process the disconnection and return a message stating: "Z: was deleted successfully."
  6. If you have multiple disconnected, broken, or non-responsive mapped drives that you want to clear simultaneously, type net use * /delete and press Enter.
  7. The system will prompt you for confirmation: "Do you want to continue this operation? (Y/N)". Type Y and press Enter to clear all active mapping profiles.


Method 3: Advanced PowerShell SMB Session Removal

PowerShell offers deep instrumentation of the Windows Management Instrumentation (WMI) engine, allowing system engineers to easily manage SMB mappings across remote servers and enterprise systems.



  1. Right-click the Windows Start button and select "Windows PowerShell (Admin)" or "Terminal (Admin)".
  2. To see all active SMB network mappings established on the current user profile, type Get-SmbMapping and press Enter.
  3. Review the output columns, noting the "LocalPath" (the drive letter) and the "RemotePath" (the backend network share location).
  4. To target and remove a specific mapping, type Remove-SmbMapping -LocalPath "Z:" (replacing Z: with the target letter) and press Enter.
  5. To bypass confirmation prompts and force-terminate the SMB connection, even if file locks exist, append the force switch: Remove-SmbMapping -LocalPath "Z:" -Force and press Enter.
  6. To remove the mapping configuration from your persistent user profile entirely, preventing it from attempting to reconnect during the next login cycle, type Remove-SmbMapping -LocalPath "Z:" -UpdateProfile and press Enter.

Pro-Tip: If the drive was mapped using a temporary session identifier not managed by SMB (such as an FTP or WebDAV mount), use the core PowerShell drive engine command instead: Remove-PSDrive -Name Z (note that the colon is omitted when using the Name parameter in this specific cmdlet).



Method 4: Manual Registry Purge for Stubborn or Phantom Drives

Occasionally, system crashes, domain controller changes, or registry corruption will leave behind "phantom" network drives. These drives show up in File Explorer with red "X" icons but cannot be unmapped using standard GUI or CLI tools, often returning errors like "The network connection could not be found."



  1. Press the Windows Key + R to open the Run dialog box.
  2. Type regedit into the field and press Enter. Click "Yes" on the User Account Control (UAC) prompt to open the Registry Editor.
  3. In the left-hand navigation pane, navigate to the following path: HKEY_CURRENT_USER\Network.
  4. Click the arrow next to the "Network" folder key to expand it. Inside, you will see subkeys named after the drive letters currently mapped to your user profile (for example, "Z").
  5. Right-click the folder key corresponding to the stubborn drive letter (for example, right-click the "Z" folder) and select "Delete". Click "Yes" to confirm the deletion.
  6. Next, navigate to the explorer tracking path to prevent the shell from rendering cached connections: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2.
  7. Expand the "MountPoints2" registry key. This subkey contains a list of all network shares you have ever accessed, formatted as remote server names (for example, "##ServerName#ShareName").
  8. Scroll through the list, locate the key representing your problematic share, right-click it, and click "Delete".
  9. Close the Registry Editor.
  10. To apply these changes, press Ctrl + Shift + Esc to open Task Manager. Scroll down to find "Windows Explorer", right-click it, and select "Restart". Alternatively, log off your Windows user session and log back in.


Method 5: Unmapping Network Volumes on macOS

For hybrid environments, macOS users must also unmount SMB, AFP, or NFS network volumes to maintain clean system paths.



  1. Open Finder on your Mac.
  2. Locate the "Locations" category in the left sidebar.
  3. Hover your cursor over the mapped network share name. An "Eject" icon (an upward-pointing triangle over a horizontal line) will appear next to it.
  4. Click the "Eject" icon to unmount the volume.
  5. Alternatively, if the network share has a shortcut icon on your desktop, drag the network drive icon directly to the "Trash" icon on your dock. The trash icon will dynamically change into an eject symbol.
  6. If the share is non-responsive, open the Terminal application and type the following command: diskutil unmount force /Volumes/ShareName (replacing ShareName with the exact name of your mounted folder) and press Enter.

How to Map a Network Drive on Windows

How to Map a Network Drive on Windows

Comparison of Network Drive Disconnection Methods



Administration Interface Target Skill Level Command Executed / Interface Path Persistence Removal Speed (Execution to Completion) Ideal Operational Scenario
File Explorer GUI Novice / End-User Right-click drive under "This PC" -> Click "Disconnect" Automated 5-10 Seconds Standard desktop maintenance, single-drive cleanup.
Command Prompt (CLI) System Administrator net use Z: /delete Manual / Scriptable 2-3 Seconds Bulk workstation management, deployment scripts, or frozen GUI.
PowerShell (PS) DevOps / Enterprise Admin Remove-SmbMapping -LocalPath "Z:" Permanent (via UpdateProfile) 2-3 Seconds Active Directory domain management, automated remote unmapping.
Windows Registry Advanced IT Specialist HKCU\Network & HKCU...\MountPoints2 Permanent Force-Delete 1-2 Minutes (Requires Shell Restart) Resolving phantom drives, registry corruption, or error 2250.
macOS Finder/Terminal Multi-Platform Admin diskutil unmount force or Finder Sidebar Automated 3-5 Seconds Clearing SMB/AFP shares on macOS client devices.

Troubleshooting Persistent Mapping Failures and Network Errors

When unmapping network drives, you may encounter edge cases where security restrictions, active resource locks, or system bugs block the normal process. Below are the most common real-world failures and their solutions.



System Error 2250 (The network connection could not be found)



  • Root Cause: This error occurs when Windows tries to unmap a drive letter that the local shell remembers, but the underlying network redirector has already closed or lost track of. It commonly happens after dynamic IP changes, VPN disconnections, or sleep cycles.
  • Actionable Fix: Force-terminate the registry entries for the mapping. Open regedit, delete the target drive letter folder from HKEY_CURRENT_USER\Network, delete the server cache folders under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2, and restart the Explorer.exe process.


System Error 1219 (Multiple connections to a server by the same user are not allowed)



  • Root Cause: This occurs when you try to disconnect a drive or connect a new one while hidden background processes are still talking to the same target server using a different set of credentials. Windows restricts concurrent connections to a single UNC path with different user names.
  • Actionable Fix: Terminate all connections to that server. Open Command Prompt and run net use * /delete /y to clear all active network sessions. Next, open the Windows Credential Manager from the Control Panel, locate the stored Windows Credentials associated with the server IP or host name, remove them, and restart your computer.


The Reappearing Drive After System Reboot



  • Root Cause: The network drive is being remounted automatically by an active Active Directory Group Policy Object (GPO), a logon script configured by your network administrator, or a persistent startup batch file.
  • Actionable Fix: Open Command Prompt and run gpresult /h gpreport.html to generate an HTML report of your active group policies. Search this report for "Drive Maps". If managed by GPO, contact your system administrator to change the GPO action from "Map" or "Create" to "Delete". If it is a local setup, check your Windows Startup folder (accessible via shell:startup in the Run dialog) or your local Task Scheduler for persistent mapping scripts.


The Device is Currently in Use Error



  • Root Cause: A local application has an open file handle on the mapped drive, or Windows Explorer is trying to generate preview thumbnails for files within the shared directory.
  • Actionable Fix: Close all open applications. If the error persists, use the Command Prompt to force-kill the connection by typing net use Z: /delete /y (replacing Z: with your drive letter). If this still fails, restart your computer in Safe Mode to prevent background programs from locking the network path, then run the deletion command again.

Frequently Asked Questions



What is the difference between disconnecting and unmapping a network drive?

Disconnecting and unmapping refer to the same fundamental process: breaking the active connection between your local computer and a remote network share. "Unmapping" is the formal term for releasing the designated drive letter (like Z:), while "Disconnecting" is the user-facing term used in the Windows graphical user interface.



How do I unmap a network drive for all users on a shared machine?

To remove a network mapping machine-wide, you must run the Command Prompt as an Administrator and use the system-level syntax: net use Z: /delete /global. If the drive was mapped using a system account or a startup script, you may also need to delete the corresponding drive letter key from the system-wide registry path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider.



Why does my unmapped network drive keep returning after I restart Windows?

This issue occurs because the drive was originally mapped with the persistent flag enabled (which tells Windows to remount the connection during every logon). To resolve this, unmap the drive using the PowerShell cmdlet Remove-SmbMapping -LocalPath "Z:" -UpdateProfile, which explicitly updates your active user profile to prevent the system from attempting to reconnect the drive on future boots.



How can I force disconnect a network drive when it says the device is in use?

To force a disconnection, run the command net use Z: /delete /y in an elevated Command Prompt. The /y flag automatically answers "Yes" to all system safety prompts, bypassing active file locks and immediately severing the SMB transport layer.



Can I unmap a network drive using a Group Policy Preference?

Yes. Open the Group Policy Management Console and navigate to User Configuration, then Preferences, then Windows Settings, and select Drive Maps. Locate the drive letter policy, change its Action property from "Update" or "Replace" to "Delete", and apply the changes. The drive will be automatically unmapped on client workstations during the next policy refresh cycle.

Secure Your Network Architecture

If your organization is migrating away from legacy on-premises file servers to secure cloud-based repositories, clean up your systems by systematically unmapping your legacy network drives today. To implement automated, zero-trust cloud directory services across your enterprise network, contact our IT systems integration team to schedule a custom infrastructure consultation.


How To Get Full Path Of Mapped Network Drive In Windows 10 - Templates ...

How To Get Full Path Of Mapped Network Drive In Windows 10 - Templates ...

Read also: A complete beginner antenna guide