Using the command line to delete a Windows mapped network drive
Windows still has this broken system that freezes the right-click menu even now? Deleting mapped drives via command line counts as a task. Really, nobody fixes this old problem from the XP era?
目录6 个章节
Preface
I have to complain a bit—Windows is really a hot mess.
I've been criticizing Windows since college, and I can't believe it's still this bad now 🤣
I recently upgraded my NAS.
Previously, these three network mapped drives (W:, X:, Y:) were mapped to the TKL FileServer via SMB.
Now that I've migrated to TrueNAS, I need to remap them.
But these right-click menus keep freezing.

Solution
Windows Explorer requests the shared status (capacity, thumbnails, context menu extensions) of these shares when you right-click. If the NAS is unresponsive or the network is slow, it can freeze.
You can remove them via the command line instead.
Open PowerShell with administrator privileges.
net use
Output
$ net use
New connections will be remembered.
Status Local Remote Network
-------------------------------------------------------------------------------
Disconnected W: \\192.168.10.201\ssd Microsoft Windows Network
Disconnected X: \\192.168.10.201\data Microsoft Windows Network
Reconnecting Y: \\192.168.10.201\pan Microsoft Windows Network
The command completed successfully.
Delete the corresponding network drives.
net use X: /delete
net use Y: /delete
net use W: /delete
If you encounter the prompt "The connection is currently in use," add /y to force the deletion.
net use X: /delete /y
Refresh File Explorer, and the drives will no longer appear.

Suggestion
I read on the forum that this issue has existed since the XP era.
I didn't expect Windows 10 to still not have fixed it 🤣
The suggestion is to place network drive mappings inside folders to avoid lag.
Additionally, Windows also has an issue where opening Task Manager causes lag. I used the system integrity check commands, which improved the situation afterward.
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
1. sfc /scannow
- SFC = System File Checker
- Checks whether protected files in the system have been modified or corrupted.
- If issues are found, it will attempt to repair them using copies from the WinSxS cache.
- However, this assumes that WinSxS itself is intact.
2. DISM /Online /Cleanup-Image /RestoreHealth
- DISM = Deployment Image Servicing and Management
- Operates at a more fundamental level, primarily repairing the WinSxS component store (the system's "backup parts warehouse").
- Parameter explanation:
/Online→ Applies to the currently running system (not an offline image)./Cleanup-Image→ Performs cleanup or repair on the system image./RestoreHealth→ Checks and repairs corrupted files within WinSxS.
- If WinSxS itself is corrupted (which causes
sfc /scannowto fail), DISM is needed first to repair WinSxS.
References
_EOF_
Using the command line to delete a Windows mapped network drive
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
Windows平台下Git的安装与配置
一、下载 Git for Windows,主页:http://gitforwindows.org/ 点击页面中“Download”进入下载列表。可根据个人喜好选择下载版本。 这里选择下载最新版:Git-1.8.3-preview20130601.exe. 二、安装 下载完毕,双击开始安装: 1、除了AdvancedXXX选项,其余全选中 2、选择“Use Git Bash only” 3、选择
2021-12-18 · Windows · 约 1 分钟
在 Windows 10 上实现免密码 SSH 登录
在日常开发中,SSH(Secure Shell)作为一种安全的远程登录协议,广泛用于 Linux 和 Windows 系统之间的连接。为了提高效率,我们可以通过配置免密码登录,省去每次连接时输入密码的繁琐过程。
2026-08-25 · Windows · 约 1 分钟
在 Windows 11 上使用 Hyper-V 虚拟机
WSL开了Hyper-V,VMware直接报废,嵌套虚拟化?做梦。改用原生Hyper-V管理器,开启倒简单。Windows Admin Center登录失败,懒得折腾,直接用控制台。
2026-03-10 · Windows · 约 1 分钟
IT之家学院:让Win10文件管理器的详细信息窗格显示更多信息
当你在Windows的资源管理器中将详细信息窗格设置为可用,然后选中一个文件时(IT之家小编选中了一个exe文件),你将在窗口的右半部分看到这个文件的一些信息,包括修改日期、创建日期、文件大小和可用性,不过对于一些用户来说,这些信息十分有限,还是不够详细。 在这篇文章中,IT之家将为大家演示如何进行设置,以使文件资源管理器可在详细信息窗格中显示更多的关于已被选中的文件的有用信息。 下文中的方法适用
2021-12-18 · Windows · 约 1 分钟
讨论
共 0 条加载评论中…