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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Aug 10, 2012, 1:00 AM EDT
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