Wishlist 0 ¥0.00

Windows 10快速删除大量回收站文件以及由此引起的回收站右键清空反应慢问题的解决

这个博文的标题很长,我稍微解释一下。

前几天在Windows 10上收集一些数据,由于删除了几万个小文件,发现回收站清空的时候特别慢,就想用类似rd/s/q的方法快速清空,看到了这里的帖子:清空回收站因文件太多卡住怎么办? | 小赖子的英国生活和资讯

应该说这个网友的介绍是对的,但是他少介绍了一步,最好是通过管理员方式运行。我之前没有,虽然也清空回收站了,但是从此之后在回收站图标上点右键——清空回收站的时候,两步都反应特别慢,大概至少要间隔5秒左右。觉得好奇怪,感觉可能是之前那种操作的问题。虽然在网上搜索的时候,看到这个文章:https://www.easeus.com/recover-deleted-files/fix-corrupted-windows-10-recycle-bin-and-restore-lost-data.html,里面很清楚说了要用管理员方式。所以我按照下面的步骤重新清空了一遍回收站(需要删掉大量文件的朋友也可以这么做):

开始——Windows系统——“命令提示符”(也就是cmd)——右键——更多——以管理员身份运行——在弹出的cmd窗口中输入:

    for %d in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @(
        @if exist %d:\$Recycle.Bin\NUL rd /s /q %d:\$Recycle.Bin
    )

可以直接粘贴。然后就可以把每个盘符下的回收站文件彻底删除了,再重启一次电脑,发现右键点击回收站的时候,速度也变正常了。这个bug太隐蔽了,估计微软也很难测试出来。

2023年6月19日更新:

想不到我也又用了一次这个方法,有些朋友反映拷贝的时候有问题,我们可以把换行空格之类的全去掉:

for %d in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @(@if exist %d:\$Recycle.Bin\NUL rd /s /q %d:\$Recycle.Bin)

这样就肯定没有什么格式上的问题了。

 

参考文章:

清空回收站因文件太多卡住怎么办?

empty-recycle-bin 清空回收站因文件太多卡住怎么办? I.T. 小技巧

empty-recycle-bin hangs

回收站里的文件总共有 40多G 所以操作系统在寻找他们的过程中停止响应了. 最好的办法还是通过命令行 比如:

rd /s /q %systemdrive%\$Recycle.Bin

一般来说: %systemdrive% 系统盘指的是 C:\ 但是被回收的文件都是按盘符存在不同的盘符下的 $Recycle.Bin 隐藏文件夹下 所以我们可以在命令行下运行一个 For:

for %d in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @(
    @if exist %d:\$Recycle.Bin\NUL rd /s /q %d:\$Recycle.Bin
)

参数 /s 指定了 rd 命令会删除子目录和文件, /q 则不会提示是否删除的信息. 命令行下 一会儿就把回收站给清空了. 所以说 还是命令行效率高一些 靠谱些.

How to Empty Recycle Bin when it hangs due to lots of files?

Once, the Google Drive moves lots of deleted files into Recycle bin and I was trying to empty the recycle bin using the intuitive way, right click Recycle and click the Empty. But it takes a long time before it shows the following and hangs forever.

empty-recycle-bin How to Empty Recycle Bin when it hangs due to lots of files? bash script tricks windows windows batch

empty-recycle-bin hangs

The files in the Recycle bin are about 40GB and it seems the Windows OS is trying to figure out the size. The desktop may freeze during its process to finding out what those files to delete but it is not necessary. The solution to empty recycle bin correctly is to launch the command shell and run the command:

rd /s /q %systemdrive%\$Recycle.Bin

Normally, the %systemdrive% refers to C:\ but the files are spread out to different drive letters, so you would need to do a loop:

for %d in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @(
    @if exist %d:\$Recycle.Bin\NUL rd /s /q %d:\$Recycle.Bin
)

The /s of rd command removes subtrees of a folder and /q is the quiet model so it does not prompt for deletion. After a while, it silent returns to the DOS prompt and the recycle bin is emptied.

 

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.