How To Unmap A Network Drive In Windows: Step-by-Step Command Line And GUI Methods

How To Unmap A Network Drive In Windows: Step-by-Step Command Line And GUI Methods

Guide to Resolve Windows 11 Mapped Drive Not Showing Up

To safely unmap a network drive in Windows, you must cleanly sever the logical link between your local operating system drive letter and the remote Universal Naming Convention (UNC) path. This procedure can be successfully executed via the Windows File Explorer graphical interface, the Command Prompt utility using legacy terminal commands, or through advanced scripting in Windows PowerShell. Terminating these mapped connections is a critical operational step when resolving directory conflicts, refreshing active directory credentials, or mitigating network-induced explorer.exe latency.


Pre-Disconnection Assessment & System Requirements

Before initiating the unmapping process, it is vital to evaluate the active state of your system connections. Unmapping a network drive that is currently engaged in an active read/write operations or locked by a background thread can cause application freezes, data corruption within network files, or prolonged terminal hangs. Network drive mappings in Windows operate within the context of specific user security tokens; thus, connections established under a standard user context must be manipulated within that same user context, whereas administrative connections require matching elevated access.



Operational Prerequisites Checklist



  • Target Connection Data: You must identify the exact mapped drive letter (from A: to Z:) or the direct UNC path (such as \server-name\share-name) that needs to be unmapped.
  • Active File Handles Verification: Verify that no local applications, text editors, command shells, or background synchronization processes are utilizing files stored on the target network volume.
  • Credential Verification: Ensure you have access to the credentials utilized to map the connection if you intend to re-establish a corrected path immediately following the unmapping procedure.
  • System Tools: Access to Windows File Explorer (for GUI-based disconnection), Command Prompt (cmd.exe), Windows PowerShell (powershell.exe), or the Windows Registry Editor (regedit.exe) for advanced persistence cleanup.
  • Time and Budget Benchmarks: This administrative procedure requires zero financial expenditure and typically executes in less than three minutes of hands-on technical time.

Definitive Execution Pathways for Disconnecting Network Storage

The following sections provide highly detailed, step-by-step procedures to disconnect a mapped drive. Select the method that best aligns with your access privileges and operational environment.



Step 1: Disconnecting via Windows File Explorer (GUI Method)

The graphical user interface is the most direct method for general office workstations and non-technical staff who require a straightforward way to clear mapped locations.



  1. Open the Windows File Explorer by pressing the Windows Key + E shortcut on your physical keyboard.
  2. Navigate to the left-hand navigation pane and locate the "This PC" directory. Click on it to display your system drives, network locations, and peripheral devices.
  3. Scroll down to the "Network Locations" group. Here, you will see all currently mapped network directories alongside their corresponding drive letters and server paths.
  4. Locate the specific drive letter you wish to remove. Right-click directly on the icon of the target mapped drive to open the context menu.
  5. From the drop-down menu, select the option labeled "Disconnect". Do not select "Delete" or attempt to drag the icon to the Recycle Bin, as this will not cleanly unbind the drive letter from the network stack.
  6. Once selected, Windows will attempt to close the active connection. The drive icon will disappear from the "This PC" display, freeing up the allocated drive letter for local or alternative network assignments.

Pro-Tip: If the "Disconnect" option is grayed out or fails to respond, a background system thread or file indexer is likely scanning the remote share. Closing all active application windows and restarting the explorer.exe process via Task Manager will typically resolve this lock state.



Step 2: Unmapping via Command Prompt (CLI Method)

For system administrators, batch file deployment, and terminal-focused workflows, the legacy Command Prompt utility provides a fast and reliable way to clear drive allocations using the network use utility.



  1. Open the Windows Start Menu, type "cmd" into the search bar, and select "Command Prompt". If the target network drive was mapped with elevated administrative permissions, right-click the application and select "Run as administrator". Otherwise, run it in standard user mode to match the mapping context.
  2. Type net use into the terminal and press the Enter key. This command queries the system and outputs a structured list of all currently active remote connections, their assigned drive letters, and their current network status (such as OK, Disconnected, or Unavailable).
  3. To unmap a specific network drive, use the syntax net use Z: /delete (replacing Z: with the actual drive letter you wish to disconnect) and press Enter.
  4. If the drive has active file locks or is temporarily unresponsive, you can append the force flag to the command by typing net use Z: /delete /y and pressing Enter. This instructs the operating system to immediately terminate the mapping without prompting you for safety confirmations.
  5. To clear all mapped network drives in a single action, execute the command net use * /delete and press Enter. The system will prompt you with a confirmation request; type Y and press Enter to approve the global disconnection of all network shares.

Warning: Running net use * /delete will sever connections to all network drives, including active database backends, application hosts, and printers. Always verify that no business-critical data pipelines are relying on active drive letters before performing a global deletion.



Step 3: Removing Mapped Drives with Windows PowerShell

Windows PowerShell interacts directly with the modern Windows Management Instrumentation (WMI) engine and the Server Message Block (SMB) client layer. This makes it the preferred tool for automated IT management and SCCM-driven policy deployments.



  1. Launch Windows PowerShell by searching for "PowerShell" in the Start Menu. Depending on how the drive was mapped, open it normally or with elevated administrator rights.
  2. To view the current inventory of SMB mappings on the local computer, execute the cmdlet Get-SmbMapping and press Enter. This cmdlet returns a clean table containing the local path (drive letter), remote path (UNC server directory), and the status of each mapping.
  3. To remove a specific network drive, use the syntax Remove-SmbMapping -LocalPath Z: (replacing Z: with the letter of your target drive) and press Enter.
  4. In enterprise environments where network policies might attempt to maintain or block the disconnection, you can run a forced parameter command to override system locks by executing Remove-SmbMapping -LocalPath Z: -Force and pressing Enter.
  5. If you need to remove a drive that was mapped using an explicit remote path rather than a local drive letter, you must target the remote path by executing Remove-SmbMapping -RemotePath \server-name\share-name and pressing Enter.


Step 4: Clearing Stubborn "Ghost" Drives via the Registry

Occasionally, mapped drives can become corrupted or stuck in a semi-connected state, appearing in File Explorer but refusing to disconnect via GUI, CMD, or PowerShell. These are known as "ghost" drives, and they must be cleared directly out of the Windows Registry.



  1. Press the Windows Key + R on your keyboard to open the Run dialog box. Type regedit and press Enter to launch the Windows Registry Editor. You will need to accept the User Account Control (UAC) security prompt to proceed.
  2. In the left navigation pane of the Registry Editor, expand the folders to navigate to the following path: HKEY_CURRENT_USER\Network
  3. Under the Network key, you will see subkeys corresponding directly to the drive letters currently mapped for the active user account (for example, a key named Z). Expand these keys to confirm they point to the correct UNC server path.
  4. Right-click the folder representing the stuck drive letter and select "Delete". Click "Yes" to confirm the deletion of the key.
  5. Next, navigate to the secondary cache of explorer mount points by traversing the following path: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2
  6. Expand the MountPoints2 key. Inside, you will see list keys formatted as ##server-name#share-name. Scroll through this list, find the folder representing the stubborn network share, right-click it, and select "Delete".
  7. Close the Registry Editor. To apply the changes, restart your computer or open Task Manager, locate "Windows Explorer" in the Processes tab, right-click it, and select "Restart".

From Strangers to Collaborators: How the Right Network Drives Real Gro ...

From Strangers to Collaborators: How the Right Network Drives Real Gro ...

Technical Methodology & Command Matrix

The following table provides a direct technical comparison of the available unmapping methods. This matrix helps you determine the most efficient administrative approach depending on system state, access rights, and target environments.



Unmapping Method System Privilege Level Connection Persistence Control Best Use Case Primary Execution Command / Action
File Explorer GUI Standard User Controlled via GUI settings Casual desktop users, ad-hoc cleanup Right-click mapped drive -> Disconnect
Command Prompt (CMD) Matches Mapping Context Yes, via /persistent:no flag Batch scripting, legacy systems, rapid administrative unmapping net use [Drive_Letter] /delete
Windows PowerShell Matches Mapping Context Yes, via WMI configuration Enterprise IT automation, modern scripting, SCCM deployments Remove-SmbMapping -LocalPath [Drive_Letter] -Force
Windows Registry Local Administrator Permanent deletion of persistence keys Repairing corrupted, ghost, or unresponsive mapped drives Delete keys under \Network and \MountPoints2

Network Disconnection Failures & System Resolution Protocols

When working with networked filesystems, latency, permission mismatches, and offline states can lead to unmapping errors. Below are the most common real-world failure scenarios along with their diagnostic root causes and immediate technical resolutions.



Scenario 1: The Terminal Returns "The network connection could not be found"



  • Root Cause: This error typically occurs when the drive letter is visible in File Explorer but was originally mapped within a different security token context (such as an elevated Administrator shell while you are attempting to unmap it from a non-elevated command line). It can also occur if the mapping has entered a stale state where the underlying connection to the physical server has been severed, but the virtual drive letter remains registered in the active explorer session.
  • Actionable Fix: Open a command line matching the security context of the original mapping. If that does not resolve the error, query the system using the command net use to identify if the drive exists under a blank local name, or execute net use * /delete to force-clear the system's active connection list.


Scenario 2: Unmapped Network Drives Reappear Automatically After Rebooting



  • Root Cause: The unmapped network drive was originally configured with a persistent flag, or there is an active Group Policy Object (GPO) or local logon script running on your network domain. Every time your computer boots and authenticates against the Active Directory domain controller, the system-level scripts run and re-establish the connection.
  • Actionable Fix: Navigate to the Windows Registry and verify that no remnants of the drive letter exist in HKEY_CURRENT_USER\Network. If the drive continues to reappear, contact your network administrator to check if a GPO loopback processing policy, a preferences map-drive item, or a corporate logon script (typically named logon.bat or logon.ps1) is configured to map the drive upon user authentication.


Scenario 3: "The device is in use" or "Files are open" Disconnection Block



  • Root Cause: The operating system cannot unbind the drive letter because a system process or application currently holds an active handle on a file or folder within the mapped directory. This is common when file indexers, antivirus scanners, command prompts, or third-party editing programs are active in the background.
  • Actionable Fix: Close all active programs, including background file managers and Command Prompt windows. Open Windows PowerShell and run Remove-SmbMapping -LocalPath Z: -Force to forcibly break the connection. If the lock persists, you can temporarily stop the Workstation service by opening CMD as Administrator and executing net stop lanmanworkstation /y, followed by net start lanmanworkstation to restart the network client stack.

Frequently Asked Questions



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

There is no functional difference between these two terms. "Disconnecting" is the common terminology used within the graphical user interface of Windows File Explorer, whereas "unmapping" is the technical term used by systems engineers and administrators to describe the removal of a drive letter binding from a UNC path.



Why does unmapping a network drive in CMD not remove it from File Explorer?

This discrepancy occurs because of user access token separation (User Account Control). If you open CMD with administrative privileges and unmap a drive, it removes the drive within the Administrator's session, but the mapping remains visible in your standard user's File Explorer session. Always match the elevation level of your terminal to the elevation level of your mapped drives.



How do I unmap a network drive that has no drive letter?

Network folders mapped directly as network locations without an assigned drive letter must be removed by navigating to "This PC" in File Explorer, scrolling down to "Network Locations," right-clicking the specific folder shortcut, and selecting "Delete". This merely deletes the local shortcut container without affecting the remote files.



Can I unmap a network drive for all users on a shared computer?

No, network drive mappings are profile-specific configuration elements stored within each user's HKEY_CURRENT_USER registry hive. To remove mappings for all users, you must deploy a Group Policy Object set to "Replace" or "Delete" mapping actions, or run a startup script that executes the unmapping commands for each user profile upon system login.



Will unmapping a network drive delete the files stored on the network server?

No, unmapping a drive letter is a safe local operation. It simply dissolves the local redirection pointer on your workstation; the actual directories, folders, and files remain completely untouched on the destination network storage device or file server.

Optimize Your Corporate IT Infrastructure Management

Streamlining and securing your enterprise network storage environment is essential for preventing system downtime and ensuring seamless employee collaboration. Contact our network engineering team today to audit your current active directory configurations, optimize server access policies, and implement modern cloud-hybrid storage integrations across your organization.


How to map/unmap the Employees from the FVU generation file. - Home Page

How to map/unmap the Employees from the FVU generation file. - Home Page

Read also: How to Say She Likes in Spanish: A Comprehensive Linguistic Guide