无法删除包含PDF或DOC文件的文件夹 [英] Cannot delete folder contains PDF or DOC files

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

问题描述

微软团队,

我有一个刚刚发生的问题。之前,我使用 Directory.Delete(path,true)删除所有文件和子文件夹,并且它正常工作。

I have an issue that has just happened yesterday. Before, I use Directory.Delete(path, true) to delete all files and subfolders and it worked correctly.

但是现在,当我运行程序时对于此方法,如果文件夹包含PDF或DOC文件,则无法删除这些文件,甚至删除程序的EXE文件。这太奇怪了。

But now, when I run my program run to this method, if the folder contains PDF or DOC files, these files cannot be deleted and even the EXE file of my program is deleted. It is so weird.

如果文件夹只包含文本文件,如TXT或CSV,则可以删除这些文件。

If the folder only contains text file such as TXT or CSV, these files can be deleted.

现在我所有的文件我长时间没有改变任何东西的旧程序也存在这个问题。

Now all of my old programs that I did not changed anything for a long time also have this issue.

如果文件夹的文件少于2个,则可以删除这些文件。如果超过这个,它就不起作用了。

If the folder has less than 2 documents, these files can be deleted. If more than that, it does not work.

你能否帮我解决这个问题,让我知道如何解决这个问题?

Could you please help me with this issue and let me know how I can fix it ?

谢谢,

图。

推荐答案

通常当我遇到这个问题时,一些错误的进程会锁定文件。 重新启动计算机通常有效。

Usually when I've had this problem some errant process has a lock on a file.  Rebooting the computer usually works.


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

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