question

CPASNamur-5254 avatar image
0 Votes"
CPASNamur-5254 asked NeilBurrows-0270 answered

MoveFiles and PendingFileRenameoperations

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 ?

Thanks

windows-sysinternals-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

NeilBurrows-0270 avatar image
0 Votes"
NeilBurrows-0270 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.