Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Delete Executeable

Delete Executeable

Scheduled Pinned Locked Moved C / C++ / MFC
question
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mazdak
    wrote on last edited by
    #1

    I want after my application run ,the executable file DELETE itself.Is that possible? Mazy "The path you tread is narrow and the drop is shear and very high, The ravens all are watching from a vantage point near by, Apprehension creeping like a choo-train uo your spine, Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd

    R R 2 Replies Last reply
    0
    • M Mazdak

      I want after my application run ,the executable file DELETE itself.Is that possible? Mazy "The path you tread is narrow and the drop is shear and very high, The ravens all are watching from a vantage point near by, Apprehension creeping like a choo-train uo your spine, Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd

      R Offline
      R Offline
      Rickard Andersson20
      wrote on last edited by
      #2

      Mazdak wrote: Is that possible? No ----------------------- Perhaps if you make a batch file and run that batch file when closing your app. Make loop in your batch file that tries to delete your EXE! but your batch file will still be there... :( ------------------------------------ Rickard Andersson, Suza Computing ICQ#: 50302279 I'm from the winter country SWEDEN! ------------------------------------

      M 1 Reply Last reply
      0
      • R Rickard Andersson20

        Mazdak wrote: Is that possible? No ----------------------- Perhaps if you make a batch file and run that batch file when closing your app. Make loop in your batch file that tries to delete your EXE! but your batch file will still be there... :( ------------------------------------ Rickard Andersson, Suza Computing ICQ#: 50302279 I'm from the winter country SWEDEN! ------------------------------------

        M Offline
        M Offline
        Mazdak
        wrote on last edited by
        #3

        So,how can I make it run only for ONE time? Like trial version programs. Mazy "The path you tread is narrow and the drop is shear and very high, The ravens all are watching from a vantage point near by, Apprehension creeping like a choo-train uo your spine, Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd

        L R 3 Replies Last reply
        0
        • M Mazdak

          So,how can I make it run only for ONE time? Like trial version programs. Mazy "The path you tread is narrow and the drop is shear and very high, The ravens all are watching from a vantage point near by, Apprehension creeping like a choo-train uo your spine, Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd

          L Offline
          L Offline
          Li Mu Bai
          wrote on last edited by
          #4

          Hi Mazy How can you make it delete itself, it will be in use at the time and therefore cause an access denied prompt??? Me

          1 Reply Last reply
          0
          • M Mazdak

            So,how can I make it run only for ONE time? Like trial version programs. Mazy "The path you tread is narrow and the drop is shear and very high, The ravens all are watching from a vantage point near by, Apprehension creeping like a choo-train uo your spine, Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd

            L Offline
            L Offline
            Li Mu Bai
            wrote on last edited by
            #5

            alternatively i have just thought, Make a second app and get that to delete the first, waiting for the first one to delete. Therefore you will be left with the second app. Which is just there to remove the first and contains no info. alternatively again make a batch file :laugh:

            1 Reply Last reply
            0
            • M Mazdak

              So,how can I make it run only for ONE time? Like trial version programs. Mazy "The path you tread is narrow and the drop is shear and very high, The ravens all are watching from a vantage point near by, Apprehension creeping like a choo-train uo your spine, Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd

              R Offline
              R Offline
              Rickard Andersson20
              wrote on last edited by
              #6

              Sorry, but then I can't help you! :( But if you want an unsafe way to do it: Write something to a file (EXE, DLL or just a file) in binary (of course) and then read from that file to see if it has run before! Understand? ------------------------------------ Rickard Andersson, Suza Computing ICQ#: 50302279 I'm from the winter country SWEDEN! ------------------------------------

              B 1 Reply Last reply
              0
              • R Rickard Andersson20

                Sorry, but then I can't help you! :( But if you want an unsafe way to do it: Write something to a file (EXE, DLL or just a file) in binary (of course) and then read from that file to see if it has run before! Understand? ------------------------------------ Rickard Andersson, Suza Computing ICQ#: 50302279 I'm from the winter country SWEDEN! ------------------------------------

                B Offline
                B Offline
                Black Horus
                wrote on last edited by
                #7

                There a solution to that in msdn, if u don't find email me at blackhorus@caramail.com, so i can send u the article.

                1 Reply Last reply
                0
                • M Mazdak

                  I want after my application run ,the executable file DELETE itself.Is that possible? Mazy "The path you tread is narrow and the drop is shear and very high, The ravens all are watching from a vantage point near by, Apprehension creeping like a choo-train uo your spine, Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd

                  R Offline
                  R Offline
                  Ravi Bhavnani
                  wrote on last edited by
                  #8

                  Yes. Copy the file to a temp dir and run it from there. When the app ends, it should add a registry entry (I forget which) requesting Windows to delete it the next time Windows restarts. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups