zl程序教程

您现在的位置是:首页 >  其他

当前栏目

文件被system进程锁定,不能删除

文件进程 删除 不能 system 锁定
2023-09-14 08:59:46 时间

文件被system进程锁定,不能删除,没有明显用户进程操作此文件。

软件UNLOCKER,WHOLOCKME,LOCK HUNTER之类的,可能需要重启才能解决问题,这在生产环境 中是不可接受的。

能作的还是慢慢搜索可用解决方案。。

然后,找到此个文档,显示了被SYSTEM占用文件的解决办法,并将此归为WIN2008的一个小BUG,但不知道实际效果如何。。:

http://stackoverflow.com/questions/4378192/windows-2008-r2-kernel-system-process-pid-4-is-locking-files-and-folders

Windows 2008 R2 - Kernel (System Process PID=4) is locking files and folders

As Dani has already mentioned in the comment:

Its a bug in Windows 7 and likely in Windows Server 2008 (possibly 64bit versions only). It surfaces when you disable Application Experience service.

Re-enabling this service has fixed this problem for me.

A bit more info here as to why its causing a problem.

List of other SO questions which seem to be related:

Visual      Studio output file permissions?
用远线程实现文件自删除 点这里下载示例代码 实现文件自删除不是一个特别新的话题了,不过貌似一直没有特别完美的解决方式。从早先Gary Nebbett的堆栈溢出版本到后来的批处理、临时文件等方式,无不存在着各样瑕疵:如堆栈溢出不支持XP,临时文件(批处理)不够优雅等等。