Exe suicide

This is a discussion on Exe suicide within the Windows Programming forums, part of the Platform Specific Boards category; What's an efficient method in having an exe delete itself after completing its task?...

  1. #1
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    917

    Exe suicide

    What's an efficient method in having an exe delete itself after completing its task?
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    And why would you want to do that?

    Not for some sort of malicious purpose I hope?

  3. #3
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    917
    Actually, I asked because I was curious of how some Trojan servers do it. But, no, not for malicious purposes.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  4. #4
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    couldn't you just use a system command for that? like system("del xxxxx.exe");

    i dunno just a guess

  5. #5
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    No, an application cannot delete itself.
    You can spawn a process which will kill and delete the original process, than you can get windows to delete the spawned exectuable.

  6. #6
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    my bad

  7. #7
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    917
    Yeah, could I send some command to windows to delete the exe at a certain time? Time bomb.....
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to run an exe command in c++ and get back the results?
    By mitilkhatoon in forum C++ Programming
    Replies: 5
    Last Post: 09-21-2006, 07:00 PM
  2. Poem: Suicide Note
    By KingZoolerius66 in forum A Brief History of Cprogramming.com
    Replies: 54
    Last Post: 12-31-2003, 05:39 PM
  3. Close another exe from another exe??
    By Tony in forum Windows Programming
    Replies: 1
    Last Post: 06-12-2002, 08:19 AM
  4. insert another exe into exe
    By lliero in forum C Programming
    Replies: 8
    Last Post: 04-12-2002, 01:22 PM
  5. adding bytes to EXE to call another EXE
    By lliero in forum C Programming
    Replies: 2
    Last Post: 03-30-2002, 07:23 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21