删除文件夹中包含的Thumbs.db [英] delete folder that contains thumbs.db

查看:444
本文介绍了删除文件夹中包含的Thumbs.db的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候,我不能删除文件夹,因为它包含的Thumbs.db。我有很多文件夹(其中包含图像太)和我需要将它们移动在不同的地方,并删除原来的文件夹。但我得到这个错误:因为Thumbs.db这个正在被另一个进程使用的文件夹不能删除。移动和删除是在C#中,而现在它跳过删除拥有的Thumbs.db文件夹,这将导致大量的空文件夹。有没有一种方法来删除,即使有文件的文件夹?

Sometimes I can't delete a folder, because it contains thumbs.db. I have a lot of folders (which contain images too) and I will need to move them in a different place and delete the original folder. But I am getting this error: the folder can't be deleted because "thumbs.db" is being used by another process. Moving and deleting is made in c#, and right now it skips deleting the folders that have thumbs.db, which will result in a lot of empty folders. Is there a way to delete the folder even if it has that file?

推荐答案

我提出我的意见作为一个答案,因为它是更可读是这样的:

am submitting my comment as an answer because it is much more readable this way:

您可以关闭一个创建这些文件:
在注册表编辑器中依次转到 HKEY_CURRENT_USER\Software\Microsoft \Windows\CurrentVersion\Policies\Explorer
和设置的 NoThumbnailCache 项的值设为1。

You can switch off a creation of these files: in Registry Editor go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer and set NoThumbnailCache entry's value to 1.

如果没有此项,只是创建它(DWORD 32)。

If you don't have this entry , just create it (DWORD 32).

有关的Win 7旗舰版/专业版:
HKEY_CURRENT_USER\Software\Microsoft\ Windows\CurrentVersion\Explorer\Advanced

For Win 7 Ultimate/Professional version: HKEY_CURRENT_USER\Software\Microsoft\ Windows\CurrentVersion\Explorer\Advanced

DisableThumbnailCache (DWORD也)

要删除所有已经存在的文件创建一个具有以下内容的批处理文件:

To delete all already existing files create a batch file with the following content:

cd c:\

del /s /q thumbs.db

和运行它的以管理员身份

这篇关于删除文件夹中包含的Thumbs.db的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆