I need the simplest self killing exe in delphi

Asked By 100 points N/A Posted on -
qa-featured

I need the simplest self killing exe in delphi. What I have right now contains a batch file so that the EXE file removes itself. I wanted to remove this batch file. Are there any other ways?

SHARE
Answered By 0 points N/A #133910

I need the simplest self killing exe in delphi

qa-featured

The batch file is necessary and it should be there , otherwise you won't be able to remove the .exe executable file.

Only a batch file can delete itself as it is interpreted line by line not processed as a whole so the file will not be locked during deletion. 

If you want to delete the batch file you can use MoveFileEx() and either wait until reboot or move the file to temp directory until the next machine reboot

Login/Register to Answer

Related Questions