MoveFiles and PendingFileRenameoperations

CPAS Namur 1 Reputation point

I try to replace files during reboot using the PendingFileRenameoperations registry value.

On reboot the files are not renamed but the key is deleted. I don't know why it's not working.

So to check if it's not a bug in my code, I tried the sysinternals "movefiles" and "pendmoves" tools.

The pendmove show the files that need to be replaced, so it's ok.

Since it's not working with my code, I tried to use the movefiles to write the registry key. It's added to the registry but event with that tool, the files are not replaced at reboot.

Is the some tricks to make it work on Windows 10 21H1 ?


Advanced system utilities to manage, troubleshoot, and diagnose Windows and Linux systems and applications.
1,102 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Neil Burrows 6 Reputation points

    I have the same problem, and what I am finding is that Movefile will not replace an existing file. If it is being moved to a new filename then it works fine.

    A potential workaround is to queue 2 movefile commands. 1st to delete the existing file, and 2nd to move the new file into place. However I am wary about doing this as I am not sure that the commands are run in sequence.

    0 comments No comments