I am trying to kill my program on button click, and also delete the executable. So like, "Remove program from your computer?" - If yes then kill the process and remove the file.
I've got as far as using kill to delete the .exe and then kill the process, but i can't delete the .exe cause the process has not been killed...
So,
I tried killing the process and then using kill to delete the .exe but as soon as the process was killed, obviously the program couldn't execute the next line of code because the program was terminated.
I'm kinda stumped. Is there a way to delete a file that is in use?
I've got as far as using kill to delete the .exe and then kill the process, but i can't delete the .exe cause the process has not been killed...
So,
I tried killing the process and then using kill to delete the .exe but as soon as the process was killed, obviously the program couldn't execute the next line of code because the program was terminated.
I'm kinda stumped. Is there a way to delete a file that is in use?