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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How could i develop a running-once application

How could i develop a running-once application

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 5 Posters 1 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.
  • G Offline
    G Offline
    ginee
    wrote on last edited by
    #1

    Hi, How can i develop a application which can execute once and the executive file would be removed from device. Like: After program show a message, this executive file is removed. I got a straight way that after the application executes, deleting this application file. But how? Running program couldn't delete itself. Any suggestion is welcome. Thanks! Regards, ginee

    S L A 3 Replies Last reply
    0
    • G ginee

      Hi, How can i develop a application which can execute once and the executive file would be removed from device. Like: After program show a message, this executive file is removed. I got a straight way that after the application executes, deleting this application file. But how? Running program couldn't delete itself. Any suggestion is welcome. Thanks! Regards, ginee

      S Offline
      S Offline
      Scozturk
      wrote on last edited by
      #2

      Hi, One solution is to create a .bat file with deleting instructions. You will call the bat file at the end (before return). That work's generally. I hope this helps... Well... I am a beginner ...

      G 1 Reply Last reply
      0
      • G ginee

        Hi, How can i develop a application which can execute once and the executive file would be removed from device. Like: After program show a message, this executive file is removed. I got a straight way that after the application executes, deleting this application file. But how? Running program couldn't delete itself. Any suggestion is welcome. Thanks! Regards, ginee

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I think i read some articles briefly on www.codeguru.com Try Google for "self deleting executable" (http://www.google.co.in/search?hl=en&ie=UTF-8&q=self+deleting+executable&meta=[^]) I sure you will get some. Hope this helps ------------------------- Have a great day ahead! Regards, Sohail Kadiwala

        1 Reply Last reply
        0
        • S Scozturk

          Hi, One solution is to create a .bat file with deleting instructions. You will call the bat file at the end (before return). That work's generally. I hope this helps... Well... I am a beginner ...

          G Offline
          G Offline
          ginee
          wrote on last edited by
          #4

          While that program is running (before return or some other interrupt, this program doesn't be terminated), i think the executive file is locked. And it can be deleted or moved. However, i will try this way. Thanks you!

          A 1 Reply Last reply
          0
          • G ginee

            Hi, How can i develop a application which can execute once and the executive file would be removed from device. Like: After program show a message, this executive file is removed. I got a straight way that after the application executes, deleting this application file. But how? Running program couldn't delete itself. Any suggestion is welcome. Thanks! Regards, ginee

            A Offline
            A Offline
            Arsalan Malik
            wrote on last edited by
            #5

            Please check the following article::eek: http://www.microsoft.com/msj/archive/SF9C.aspx Arsalan Malik

            1 Reply Last reply
            0
            • G ginee

              While that program is running (before return or some other interrupt, this program doesn't be terminated), i think the executive file is locked. And it can be deleted or moved. However, i will try this way. Thanks you!

              A Offline
              A Offline
              Anonymous
              wrote on last edited by
              #6

              I think the reason why the .bat file method works is because you put it just before return and the program you want to delete exits faster than the bat file opens...

              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