Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to cancel deferred MoveFileEx operation?

I use the below command to delete some files after reboot the machine:

MoveFileEx(PChar(File_Address), Nil, MOVEFILE_DELAY_UNTIL_REBOOT);

How can i cancel execution of this command and prevent files from deleting after reboot?

like image 967
Armin Taghavizad Avatar asked Oct 15 '11 12:10

Armin Taghavizad


1 Answers

Files you enqueue for deletion this way are placed in the registry under HKLM\System\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations. Perhaps you can delete entries from there, to prevent the files from being deleted. I couldn't find an API function for this.

like image 190
CodeCaster Avatar answered Sep 23 '22 03:09

CodeCaster