如何删除无法删除的文件和文件夹?

格伦纳鲁

我有一个以前WindowsDocuments and Settings文件夹的备份副本,该文件夹仅包含我的原始用户,并且在另外2个目录内:FavoritesLocal Settings

当我尝试删除时,出现Local Settings此错误:

替代文字

当我尝试删除时Favorites,出现此错误:

替代文字

我在cmd shell中运行了此命令

属性*。* -r -a -s -h / s

...但是它没有帮助,也没有返回任何错误/警告。

我曾经Unlocker v1.8.5LockHunter反复,多层次,看是否有文件正在使用,但两者总是说:没有文件锁定

更新#1:

我能够重命名目录,这现在在(尝试)删除之前向我发出此警告:

替代文字

如果按“是”(或“全部同意”),则会出现此错误:

替代文字

更新2:

我让它chkdsk /f运行需要重新启动,因为它位于我的主系统分区上。在第2阶段扫描期间,我收到了大约40个以下信息:

从文件25的索引$ 0删除索引条目。

...其次是:

删除文件37576的索引$ I30中的索引条目cookie。

...但是尝试删除时,我仍然得到上面的第一个错误对话框。

这次,我再次运行chkdsk chkdsk /f /r没有产生任何消息。删除时的结果相同。

更新#3:

深入研究,99是此处深处的许多目录之一的名称:

C:\ Documents and Settings.OLD \ User \ Local Settings \ Application Data \ Microsoft \ Messenger \ [email protected] \ SharingMetadata \ [email protected] \ DFSR \ Staging \ CS {D4E4AE55-B5E2-F03B-5189-6C4DA6E41788 } \

在每个目录中都有名称如下的文件:

2300- {C93D01AC-0739-4FD9-88C7-13D2F21A208E} -v2300- {C93D01AC-0739-4FD9-88C7-13D2F21A208E} -v2300-Downloaded.frx

我注意到,与所有目录不同,我无法重命名这些文件中的任何一个。我还注意到文件名和目录名非常长:

原始目录= 194个字符
文件名= 100+个字符
总长度超过了255个字符的限制,这很糟糕,这将解释我在更新#1中发布的错误消息。

部分解决方案:

重命名所有目录,直到总路径长度小于100。之后,我能够重命名.frx文件,更不用说删除Local Settings目录中的所有内容了

这只是部分解决方案,因为这些(空)目录仍不可删除,

C:\ 1 \ 2 \ Favorites \ Wien \该怎么办..
C:\ 1 \ 2 \ Favorites \ Photography \ FIRE

与上述相同的错误:

替代文字

这是两个文件夹的资源管理器属性显示的内容:

替代文字

更新#4(另一个局部解决方案):

结合使用harrymc的答案和透彻阅读这篇令人惊叹的MS-KB文章,其中包含几乎每个人的想法,然后包含一些不起眼的标题:您不能删除NTFS文件系统卷上的文件或文件夹

I was able to delete the 2nd folder C:\1\2\Favorites\Photography\FIRE - the problem being that there was an invisible trailing space at the end. I got lucky when I did an auto-complete whilst playing around with the del "\\?\<path>" command which he suggested.

NOTE: A normal del did NOT work, nor did deleting from explorer.

Now all that is left is the first directory C:\1\2\Favorites\Wien\What To Do.. (yes I tried endlessly with multiple combinations of the above solution ;)

Tamara Wijsman

del is for deleting files, rd aka rmdir is for deleting folders, so...

rd /s "\\?\C:\1\2\Favorites\Wien\What To Do.."

...should do the job! :-)

The /s parameter

removes all directories and files in the specified directory in addition to the directory itself.
Used to remove a directory tree.


如果这不起作用;甚至没有通配符/自动完成功能;那么您就有腐败问题。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章