Microsoft VSHADOW.EXE 卷影副本包含锁定文件?
我一直在使用 VSS 编写备份程序,并从 Windows SDK 6.1 示例中的 VSHADOW.EXE 开始。它通常可以工作,但我惊讶地发现某些文件仍然被锁定在它创建的卷影副本中,例如
C:\Users\Felix\NtUser.dat
C:\Users\Felix\NtUser.dat.log1
C:\Users\Felix\AppData\Local\Microsoft\Windows\UsrClass.dat
C:\Users\Felix\AppData\Local\Microsoft\Windows\UsrClass.dat.log1
...
访问卷影副本中的这些文件(使用 CreateFileEx
、CopyFileEx
code> 或使用 Total Commander 或任何其他工具)通常会给我一个错误 32(该进程无法访问该文件,因为该文件正在被另一个进程使用)。它似乎是任意发生的。怎么可能呢?
我之前的编辑(事件日志消息)结果不是这个问题的核心,因为我修复了它但没有帮助。
I've been writing a backup program using VSS and started out with VSHADOW.EXE from the Windows SDK 6.1 Samples. It generally works, but I was astonished to see that certain files are still locked inside the shadow copies it creates, such as
C:\Users\Felix\NtUser.dat
C:\Users\Felix\NtUser.dat.log1
C:\Users\Felix\AppData\Local\Microsoft\Windows\UsrClass.dat
C:\Users\Felix\AppData\Local\Microsoft\Windows\UsrClass.dat.log1
...
Accessing these files in the shadow copy (either with CreateFileEx
, CopyFileEx
or with Total Commander or any other tool) usually gives me an Error 32 (The process cannot access the file because it is being used by another process). It seems to occur arbitrarily. How can that be?
My previous edit (event log messages) turned out not to be the core of this issue, because I got it fixed and it didn't help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,有问题的文件是其他锁定文件的符号链接。卷影副本中的各个文件也是指向原始硬盘上锁定文件的符号链接。为了解决这个问题,必须解析符号链接并找出它指向的文件,然后该文件必须位于卷影副本中。
The files in question turned out to be symbolic links to other locked files. The respective files in the shadow copy were also symbolic links which pointed to the locked files on the original hard disc. To solve the problem, the symlink must be resolved and the file it points to must be found out, then this file must be located in the shadow copy.