How to Remove Old Mapped Drives From File Explorer in Windows
To remove old mapped drives from File Explorer, open File Explorer, right-click the mapped drive under This PC, and choose Disconnect. The drive letter disappears immediately, and Windows stops showing that old network location. If the drive is disconnected or greyed out, use Command Prompt with net use Z: /delete, replacing Z with the drive letter, or remove it in PowerShell with Remove-PSDrive. These steps work in Windows 10 and Windows 11, and they do not delete the files stored on the network server.
Mapped drives are useful when you regularly open a shared folder on another computer or a network-attached storage device. Over time, though, old mappings pile up. A server may have been retired, a shared folder may have moved, or you may simply have been given the wrong path. The result is the same: File Explorer shows a drive with a red X, Windows takes longer to open This PC, and every attempt to open the drive ends in an error. This guide explains every reliable way to remove old mapped drives from File Explorer, including stubborn drives that will not disconnect in the usual way.
What Is a Mapped Drive in Windows?
A mapped drive is a shortcut that assigns a drive letter, such as Z:, to a shared folder on a network. Instead of typing a long network path such as \\Server\SharedFolder every time, you open the drive letter in File Explorer as if it were a local hard drive. Windows can reconnect the mapping automatically at sign-in if you ticked the “Reconnect at sign-in” box when the drive was created.
That convenience becomes a problem when the target no longer exists. Windows still tries to reconnect at startup, waits for a server that never answers, and marks the drive as disconnected. Removing the mapping only removes the shortcut and the drive letter. It does not delete the shared folder, the files inside it, or anything on the server. If you still need the files, you can map the drive again later with the correct path.
Before You Remove an Old Mapped Drive
Take a minute to check three things before you disconnect anything. First, make sure no program has a file open from that drive. A document, spreadsheet, or media file open from the mapped drive can block removal or cause the program to report a missing file. Close those files first. Second, note the drive letter and the network path, in case you need it again. Right-click the drive, choose Properties, and copy the path shown there. Third, if the drive belongs to a work or school network, check with your IT team before removing it. Some mapped drives are created by a login script or group policy, and they may return at the next sign-in until the policy is changed.
Also, confirm that you are removing the right drive. If two mappings point to similar folders, check the path in Properties rather than guessing from the drive letter alone. A quick check now saves a later search for a folder you still needed.
Method 1: Disconnect a Mapped Drive in File Explorer
This is the fastest method, and it works for most drives that are still connected or that Windows can reach.
- Open File Explorer and click This PC in the left-hand pane.
- Find the mapped drive under Network locations. It will show a drive letter and the network path or server name.
- Right-click the drive and choose Disconnect.
- If Windows asks for confirmation, click Yes.
- Close and reopen File Explorer to confirm the drive letter is gone.
If the right-click menu does not show Disconnect, use the ribbon instead. Select the drive, click the three dots in the File Explorer toolbar, choose Disconnect network drive, and then pick the drive from the list. In older versions of Windows 10, the same option appears under the Computer tab at the top of the File Explorer window.
This method removes the mapping for your current user account only. Other people who sign in to the same computer keep their own mapped drives, which is usually what you want on a shared PC.
Method 2: Remove a Mapped Drive With Command Prompt
Command Prompt is the best option when File Explorer will not disconnect a drive, or when you want to remove several drives quickly. The net use command lists and deletes network connections, and it works in both Windows 10 and Windows 11.
- Press Windows + R, type
cmd, and press Enter. - Type
net useand press Enter to see every mapped drive, its letter, and its network path. - Type
net use Z: /delete, replacing Z with the letter of the old drive, and press Enter. - To remove every mapped drive at once, type
net use * /deleteand press Enter, then typeYto confirm. - Type
net useagain to confirm the drive is gone.
Adding /persistent:no when you map a drive in future prevents Windows from remembering it after a restart, which is a useful habit for temporary shares. If Command Prompt reports that the device is in use, close any program using files from that drive and try again. The /delete switch does not delete data on the server, so it is safe to use on a drive you no longer need.
How to Remove a Disconnected Mapped Drive
A disconnected drive is one that Windows shows with a red X because the server is offline or the path has changed. The same net use Z: /delete command usually removes it, even when File Explorer refuses. If the command says the connection cannot be found, try the exact path instead: net use \\Server\SharedFolder /delete. That form targets the network path rather than the letter, which helps when Windows has lost track of the letter assignment.
Method 3: Remove a Mapped Drive With PowerShell
PowerShell gives you a little more control, and it is handy if you prefer a modern command line or need to script the cleanup.
- Right-click the Start button and choose Terminal or Windows PowerShell.
- Type
Get-PSDrive -PSProvider FileSystemand press Enter to list the mapped drives. - Type
Remove-PSDrive -Name Z, replacing Z with the drive letter, and press Enter. - Close PowerShell and check This PC in File Explorer.
PowerShell also has a net use command available, so you can use the same delete command from Method 2 inside a PowerShell window if you prefer. If you manage several computers, the same commands can be included in a script, although on a work network you should only do that with your IT team’s approval.
Method 4: Stop a Mapped Drive From Coming Back
Sometimes a drive disappears, then reappears after a restart. That usually means something is recreating it: a login script, a group policy, a scheduled task, or the “Reconnect at sign-in” setting stored in the registry.
First, check whether the drive is mapped by a script. Look in the Startup folder by pressing Windows + R, typing shell:startup, and pressing Enter. If you find a batch file containing a net use command, remove or edit that line. Second, if your computer is on a work domain, ask IT whether a group policy maps the drive, because a policy will recreate it at every sign-in until it is changed.
For a drive mapped for your own account, Windows stores the connection in the registry under HKEY_CURRENT_USER\Network\Z, where Z is the drive letter. Advanced users can open Registry Editor, back up the registry, and delete the key for that letter. Only use this method if the other methods have failed, and never delete registry keys you do not recognise. In most home cases, the File Explorer or Command Prompt method is enough.
Comparison of Methods to Remove Mapped Drives
| Method | Best For | Speed | Handles Disconnected Drives? |
|---|---|---|---|
| File Explorer Disconnect | One normal drive | Fastest | Sometimes |
| Command Prompt net use | Stubborn or several drives | Fast | Yes |
| PowerShell Remove-PSDrive | Scripting and control | Fast | Yes |
| Registry or login script | Drives that keep returning | Slower | Yes |
If you are unsure which method to choose, start with File Explorer, then try Command Prompt. Those two cover almost every situation on a home or small-office PC.
What to Do If a Mapped Drive Will Not Disconnect
A drive that will not disconnect is usually in use, or Windows is still trying to reach a server that is slow to answer. Work through these fixes in order. Close every program, including background programs such as backup tools, that might be reading from the drive. Sign out of Windows and sign back in, then try Disconnect again before opening any files from the drive. Restart the computer, which releases any hidden lock on the connection, and try the Command Prompt command before opening File Explorer.
If the drive still remains, open Command Prompt as administrator and run net use Z: /delete /y. The /y switch skips the confirmation prompt. If you see an error saying the network connection could not be found, the mapping may already be partly removed, and a restart usually clears the leftover entry from File Explorer. As a last resort, check the registry key described above, and check for a login script that recreates the drive at startup.
For a related Windows cleanup, see our guide on how to format an SSD in Windows and Mac, and if a program is stuck while you work, our guide on how to force quit an app on Windows can help you close it safely.
Frequently Asked Questions
Does removing a mapped drive delete my files?
No. Removing a mapped drive only deletes the shortcut and the drive letter on your PC. The files remain on the network server or shared folder, and you can map the drive again with the same path if you need them.
How do I remove a mapped drive that is disconnected?
Use Command Prompt. Type net use to list the drives, then type net use Z: /delete with the correct drive letter. This works even when File Explorer does not show a Disconnect option for the greyed-out drive.
Why does my mapped drive keep coming back after I delete it?
It is probably being recreated by a login script, a group policy, or the reconnect-at-sign-in setting. Check the Startup folder and ask your IT team about group policy. On a home PC, also check the registry key for that drive letter.
Can I remove all mapped drives at once?
Yes. In Command Prompt, type net use * /delete and confirm with Y. This removes every mapped drive for your user account, so only use it if you are sure you do not need any of them.
What is the difference between disconnecting and deleting a mapped drive?
There is no practical difference in Windows. Disconnecting a drive in File Explorer and deleting it with net use /delete both remove the same mapping. Neither action deletes the files on the server.
Conclusion
Removing old mapped drives from File Explorer is a quick cleanup that stops Windows from chasing servers that no longer exist. Disconnect the drive in File Explorer for a simple case, use net use Z: /delete in Command Prompt for a stubborn or disconnected drive, and check login scripts or group policy if the drive keeps coming back. Once the old mappings are gone, This PC opens faster, File Explorer is easier to read, and you can map a fresh drive with the correct path whenever you need it.