How to Delete Mapped Drives in Windows
In this article
To delete a mapped drive in Windows, open File Explorer, right-click the drive under "This PC" or "Network," and choose Disconnect. If the drive is not visible there, use the Command Prompt with net use X: /delete (replace X with the drive letter) or PowerShell with Remove-PSDrive -Name X. This removes the shortcut to the shared folder; it does not delete any files on the remote server. You will need the drive letter and, if prompted, the same credentials used to connect. Menu labels can differ slightly by Windows version, but the steps below work on Windows 10 and 11.
What You'll Need
- A Windows PC where the mapped drive appears (Windows 10 or 11).
- The drive letter of the mapped drive (for example, Z:).
- Administrator rights if the drive was mapped for all users or by another account.
- Optional: Command Prompt or PowerShell access for stubborn drives.
Step-by-Step
- Open File Explorer. Press
Win + Eor click the File Explorer icon on the taskbar. - Go to This PC. In the left navigation pane, click "This PC." Mapped drives usually appear under "Network locations" at the bottom of the right pane.
- Find the mapped drive. Look for the drive letter and the network path (for example,
\\server\share). If you do not see it, click "Network" in the left pane to view mapped drives there. - Right-click the drive. A context menu appears.
- Choose Disconnect. The drive disappears from File Explorer. If you are prompted for confirmation, click Yes.
- Repeat for other drives. Disconnect each mapped drive you no longer need.
- If the drive is not listed or Disconnect is greyed out, use Command Prompt. Open Start, type
cmd, right-click "Command Prompt," and choose "Run as administrator." Typenet useand press Enter to list mapped drives. Then typenet use Z: /delete(replace Z with your drive letter) and press Enter. You should see "The command completed successfully." - Alternatively, use PowerShell. Open Start, type
powershell, right-click "Windows PowerShell," and choose "Run as administrator." TypeGet-PSDrive -PSProvider FileSystemto list drives, thenRemove-PSDrive -Name Z(replace Z). If the drive is persistent, also runnet use Z: /delete. - Check for leftover entries. Refresh File Explorer (F5). If the drive still appears, sign out and sign back in, or restart the PC.
Common Mistakes
- Deleting files instead of disconnecting. Disconnect only removes the shortcut; it does not delete data on the server. Do not delete the remote folder unless you intend to.
- Using the wrong drive letter. Confirm the letter in File Explorer or with
net usebefore running a delete command. Deleting the wrong letter can remove a different mapping. - Running commands without admin rights. If the drive was mapped by another user or for all users, a standard Command Prompt may return "Access is denied." Run as administrator.
- Forgetting persistent mappings. A drive that reappears after reboot was mapped with the "Reconnect at sign-in" option. Use
net use Z: /delete /yor remove it from the user's profile. - Confusing mapped drives with local drives. Do not attempt to disconnect a physical disk; only network locations can be disconnected this way.
Tips
- To see all mappings at once, run
net usein Command Prompt; it lists drive letters, remote paths, and connection status. - If you only want to hide a drive temporarily, you can disconnect and reconnect later using the same path and credentials.
- For drives mapped by a script or Group Policy, disconnecting manually may not stick; ask your administrator to update the policy.
- Use
net use Z: /delete /yto skip the confirmation prompt in scripts. - After disconnecting, clear any saved credentials in Credential Manager if you no longer need access to that server.
Troubleshooting
- "The network connection could not be found" when deleting. The drive may already be disconnected or the letter is in use by another device. Run
net useto confirm the exact letter, then try again. - "Access is denied." Open Command Prompt as administrator. If the drive was mapped under another user account, sign in as that user or remove the mapping from that profile.
- Drive reappears after restart. It is set to reconnect at sign-in. Disconnect it while signed in, or delete the persistent mapping with
net use Z: /delete /y. Check Task Scheduler and Startup folder for scripts that remap it. - Disconnect option missing. The drive may be a local drive or a shortcut, not a mapped network drive. Verify by right-clicking and checking for "Disconnect" or by running
net use. - Command says "The device is being used by another process." Close any open files or programs using the drive, then retry. If it persists, restart the PC and delete the mapping before opening anything.
- Drive still visible in File Explorer after deletion. Press F5 to refresh. If it remains, sign out and back in; File Explorer caches network locations.
Frequently Asked Questions
Does disconnecting a mapped drive delete the files on the server?
No. Disconnecting only removes the local shortcut. Files on the shared folder remain untouched.
Can I delete a mapped drive without admin rights?
Yes, if you mapped it under your own user account. Drives mapped for all users or by another account require administrator rights.
How do I remove a mapped drive that keeps coming back?
It is likely set to reconnect at sign-in or recreated by a script. Use net use Z: /delete /y and check Startup and Task Scheduler for remapping scripts.
What is the difference between Disconnect and Delete in File Explorer?
File Explorer offers "Disconnect" for mapped drives. "Delete" applies to files and folders, not to the drive mapping itself.
Can I delete all mapped drives at once?
Yes, in Command Prompt run net use * /delete. You will be asked to confirm; add /y to skip the prompt.
Will disconnecting a mapped drive affect other users on the same PC?
No, mappings are per user. Disconnecting yours does not remove mappings for other accounts on the same computer.