-1
2
For this code golf challenge, you must produce a .exe runnable on windows. After running this .exe from any path with any name it must be deleted after execution.
My reason for limiting this to windows is something like this may be significantly easier if you have some niche OS.
Language(and code) used to produce the .exe is irrelevant, the file size of the executable is what will be measured for this. But still post the code used to produce it, along with the resulting file size.
This is code golf, but again the goal is the smallest executable file.
1You give a reason for limiting to one only OS, but certainly not a reason to limit to windows. – Pierre Arlaud – 2014-01-03T16:11:46.903
2@ArlaudPierre Well, I had to pick one, and (unfortunately) I have more experience with it. – Cruncher – 2014-01-03T16:15:58.623
3Must the program delete only itself, or can it nuke, say, lots of other things as well? – kojiro – 2014-01-04T01:50:48.597
@kojiro I think the point is to not have it be malicious, and to be able to be tested without fear of breaking a system. – Tyzoid – 2014-01-04T01:51:31.927
2@ArlaudPierre Also, notably, windows does not allow the deletion of a program while it is running. This increases the challenge level a bit. – Tyzoid – 2014-01-04T04:28:25.710
6Linux is totally a niche OS, where
main(int a,char**b){unlink(*b);}
is all you need. (Same goes for OSX.) – fluffy – 2014-01-04T04:33:34.440Is it allowed to
strip
andupx
the exe? – o0'. – 2014-01-04T12:10:03.1801@JanDvorak Now that's strange - you shouldn't vote an existing question as duplicate for a newer one. That's not in the spirit of this site. – Howard – 2014-01-25T09:59:27.197
@Howard why not? It's perfecly legitimate on SO – John Dvorak – 2014-01-25T10:00:20.000
3@JanDvorak This is a lot like copying someone's song/book/movie, changing a couple of words and the title, and then suing them for copying you. At the very least this should go through meta first to discuss this course of action, in my opinion. – Gareth – 2014-01-25T10:18:37.653
@Gareth as if that didn't happen before. – Johannes Kuhn – 2014-01-25T10:40:22.883
@Gareth, no, its like writing a new book that is way better than the old book, and then publisher stops publishing the old book because nobody buys it anymore. – AJMansfield – 2014-01-31T16:17:33.980