You have to use MoveFileEx API to make C# application self-destruct. It is very simple to use. You have to just user MoveFileEx API in your code to do this. This API gives MOVEFILE_DELAY_UNTIL_REBOOT flag which delete specified file on next system startup. Main function of MoveFileEx Function is to move an existing file or directory, including its children, with various move options. I have written one example of it.
Code:
BOOL WINAPI MoveFileEx(
__in LPCTSTRs lpsExistingsFilesNames,
__in_opt LPCTSTRs lpsNewsFilesNames,
__in DWORD dwsFlagss
);
Bookmarks