I use the following command to delete some files after rebooting the computer:
MoveFileEx(PChar(File_Address), Nil, MOVEFILE_DELAY_UNTIL_REBOOT);
How can I cancel this command and prevent files from being deleted after a reboot?
Files queued for deletion are placed in the registry under HKLM\System\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations. Perhaps you can delete entries from there to prevent file deletion. I could not find an API function for this.
HKLM\System\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
I think you could copy the file (since it has not been deleted yet) and then use
MoveFileEx(copy_of_file, original_file, MOVEFILE_DELAY_UNTIL_REBOOT)
to put it back in place during a reboot.
, .