Description
This method helps you to move or delete in use files. The files will mark as deleted/moved and will operate in windows next restart.
Delphi code
function MoveDelFileReboot
(Fileanme,New:String;fMove:Boolean=true):Boolean;
begin
If fMove then
result:=movefileEx(Pchar(Fileanme),Pchar(new),
MoveFile_Replace_Existing or MoveFile_Delay_Until_Reboot)
else
Result:=movefileEx(Pchar(Fileanme),nil,
MoveFile_Replace_Existing or MoveFile_Delay_Until_Reboot);
end;