Disconnect a mapped network drive on Windows
Delete a drive mapping or lingering SMB connection with net use /delete.
Run `net use Z: /delete` to remove the Z: drive mapping (use `* /delete` to remove all).
01Command
Command
$ net use Z: /delete02What it does
Old mappings to a server that no longer exists make File Explorer slow and pop up errors at logon. `net use` first lists every active connection with its letter, then `net use Z: /delete` removes that one. If Windows complains that the connection is in use, close files and Explorer windows from that drive first, or use /delete with /y to force it.
03Risk
!Warning: `net use * /delete` disconnects every mapped drive at once — check the list before running it.
04Undo
Undo
$ net use Z: \\server\share /persistent:yes05Sources
- Net use - Windows CMDEvidence: Documents mapping a share to a drive letter (`net use Z: \\server\share`) and deleting a connection (`net use Z: /delete`).
- netshEvidence: Documents netsh WLAN commands including `netsh wlan show profile name=... key=clear` and `netsh wlan delete profile name=...`.
Last verified: 2026-09-18 · Category: Network