i want use c language write a delete program oneself.
for example:
#include
void main(int argc, char * argv[])
{
/*
here, do some things.
*/
/*
here, delete program oneself. codes?
*/
}
thanks.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Aug 10, 2012, 5:00 AM
What can be done is to call an external process just before your C program ends which deletes it after it's ended. However, the external process needs to be one which is certain to be present on whatever system your program is running on.
If you're still interested in trying to do this, I'd check out this article:
http://www.codeproject.com/Articles/17052/Self-Deleting-Executables