Disconnect a mapped network drive on Windows

Delete a drive mapping or lingering SMB connection with net use /delete.

Windowsnetwork-drivesmbsharesLow risk
Run `net use Z: /delete` to remove the Z: drive mapping (use `* /delete` to remove all).

01Command

Command
$ net use Z: /delete

02What 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

RiskLow risk
!Warning: `net use * /delete` disconnects every mapped drive at once — check the list before running it.

04Undo

Undo
$ net use Z: \\server\share /persistent:yes

05Sources

  • Net use - Windows CMD
    SS64 · technical · 2026-09-17
    Evidence: Documents mapping a share to a drive letter (`net use Z: \\server\share`) and deleting a connection (`net use Z: /delete`).
  • netsh
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: 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