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. Program executes automatically

Program executes automatically

Scheduled Pinned Locked Moved C / C++ / MFC
windows-admintutorialquestion
16 Posts 7 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.
  • I Identity Undisclosed

    Can some please guide me to run an exe without clicking it & restarting the pc after modification in registry. Is there any way that it can be achieved ? Regards, Ibraheem

    T Offline
    T Offline
    Tom Archer
    wrote on last edited by
    #4

    I'm not sure what you're asking but if you want to run an app after login/boot, modify the RunOnce key. http://delphi.about.com/cs/adptips1999/a/bltip0799_3.htm[^] Cheers, Tom Archer - Archer Consulting Group
    "So look up ahead at times to come, despair is not for us. We have a world and more to see, while this remains behind." - James N. Rowe

    I 1 Reply Last reply
    0
    • I Identity Undisclosed

      how will it load itself (without clicking or any user interaction) .... ???? can u plz briefly explain Regards

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #5

      It's you who needs to explain. When do you want it to run ? If you want it to run on reboot, follow Tom's advice. If you want your code to cause it to run, use CreateProcess or ShellExecute. If you want it to run every time your PC starts, put it in the Run registry key, or the startup folder. If you want precise advice, ask precise questions. Christian Graus - Microsoft MVP - C++

      I 1 Reply Last reply
      0
      • I Identity Undisclosed

        Can some please guide me to run an exe without clicking it & restarting the pc after modification in registry. Is there any way that it can be achieved ? Regards, Ibraheem

        RaviBeeR Offline
        RaviBeeR Offline
        RaviBee
        wrote on last edited by
        #6

        Following on Tom's post, here's[^] a useful link that describes the Run and RunOnce registry keys. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

        1 Reply Last reply
        0
        • T Toni78

          CreateProcess() // Afterall, I realized that even my comment lines have bugs If the sun were to blow up, it would take us 7-8 minutes to realize it.

          T Offline
          T Offline
          Toni78
          wrote on last edited by
          #7

          Christian is right. It is a little bit hard to interpret your question so I tried to guess. CreateProcess will launch the exe from within your code. ShellExecute too (this is easier to use but not recommended by Microsoft). It is impossible (a telepath would prove me wrong) to start a program without telling the computer to do so. Tom and Ravi gave you excellent answers when it comes to the exe being executed at startup without any user interaction. // Afterall, I realized that even my comment lines have bugs Time is the fire in which we burn.

          T 1 Reply Last reply
          0
          • I Identity Undisclosed

            Can some please guide me to run an exe without clicking it & restarting the pc after modification in registry. Is there any way that it can be achieved ? Regards, Ibraheem

            I Offline
            I Offline
            Identity Undisclosed
            wrote on last edited by
            #8

            Okay . I accept my mistake :P ... Well what i exactly want is say i have an executable . I know this executable can be runned by clicking it or any sort of user interaction ... or can be runned when the pc reboots ... but let say i want to run on a specific let say 10.00 am .... now other executable from outside runs that exe but this exes starts running by its own .... I hope i am little bit clear now .... Is it possible ??? and what exactly createprocess do ... can it help me in achieving this goal. i can explain it in more detail if any1 of u still dont reach to the point what I want ..... Thanx anyways Regards, Ibraheem

            F 1 Reply Last reply
            0
            • I Identity Undisclosed

              Okay . I accept my mistake :P ... Well what i exactly want is say i have an executable . I know this executable can be runned by clicking it or any sort of user interaction ... or can be runned when the pc reboots ... but let say i want to run on a specific let say 10.00 am .... now other executable from outside runs that exe but this exes starts running by its own .... I hope i am little bit clear now .... Is it possible ??? and what exactly createprocess do ... can it help me in achieving this goal. i can explain it in more detail if any1 of u still dont reach to the point what I want ..... Thanx anyways Regards, Ibraheem

              F Offline
              F Offline
              Flit
              wrote on last edited by
              #9

              Use Task Scheduler to run the executable at the desired time. That is the simplest way.

              I 1 Reply Last reply
              0
              • F Flit

                Use Task Scheduler to run the executable at the desired time. That is the simplest way.

                I Offline
                I Offline
                Identity Undisclosed
                wrote on last edited by
                #10

                Yea ... but again that would have been set by user interaction ... I want zero user interaction just like when window reboots a program can start running but I want more that is program starts of its own. That is, reboot of the window should not be needed. It starts executing of its own, even if the pc has not been restarted. Is it possible ? Regards, Ibraheem

                F F 2 Replies Last reply
                0
                • C Christian Graus

                  It's you who needs to explain. When do you want it to run ? If you want it to run on reboot, follow Tom's advice. If you want your code to cause it to run, use CreateProcess or ShellExecute. If you want it to run every time your PC starts, put it in the Run registry key, or the startup folder. If you want precise advice, ask precise questions. Christian Graus - Microsoft MVP - C++

                  I Offline
                  I Offline
                  Identity Undisclosed
                  wrote on last edited by
                  #11

                  Alrtie ... plz see my new post ... I hope u get a better idea now Regards, Ibraheem

                  1 Reply Last reply
                  0
                  • T Tom Archer

                    I'm not sure what you're asking but if you want to run an app after login/boot, modify the RunOnce key. http://delphi.about.com/cs/adptips1999/a/bltip0799_3.htm[^] Cheers, Tom Archer - Archer Consulting Group
                    "So look up ahead at times to come, despair is not for us. We have a world and more to see, while this remains behind." - James N. Rowe

                    I Offline
                    I Offline
                    Identity Undisclosed
                    wrote on last edited by
                    #12

                    Alrtie ... plz see my new post ... I hope u get a better idea now Regards, Ibraheem

                    1 Reply Last reply
                    0
                    • I Identity Undisclosed

                      Yea ... but again that would have been set by user interaction ... I want zero user interaction just like when window reboots a program can start running but I want more that is program starts of its own. That is, reboot of the window should not be needed. It starts executing of its own, even if the pc has not been restarted. Is it possible ? Regards, Ibraheem

                      F Offline
                      F Offline
                      Flit
                      wrote on last edited by
                      #13

                      All methods require some level of interaction. If there is no interaction how will the computer know what you want it to do? Putting an entry in the registry at HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run will cause your application to run when a user logs on. This does require interaction but it is very minimal and only needs to be done once. Also if there is no interaction at all how will you get your application onto the target machine?

                      C 1 Reply Last reply
                      0
                      • F Flit

                        All methods require some level of interaction. If there is no interaction how will the computer know what you want it to do? Putting an entry in the registry at HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run will cause your application to run when a user logs on. This does require interaction but it is very minimal and only needs to be done once. Also if there is no interaction at all how will you get your application onto the target machine?

                        C Offline
                        C Offline
                        Christian Graus
                        wrote on last edited by
                        #14

                        Sounds like it's a virus.... Christian Graus - Microsoft MVP - C++

                        1 Reply Last reply
                        0
                        • I Identity Undisclosed

                          Yea ... but again that would have been set by user interaction ... I want zero user interaction just like when window reboots a program can start running but I want more that is program starts of its own. That is, reboot of the window should not be needed. It starts executing of its own, even if the pc has not been restarted. Is it possible ? Regards, Ibraheem

                          F Offline
                          F Offline
                          FlyingTinman
                          wrote on last edited by
                          #15

                          If I understand correctly what you are asking it is impossible. No program can spontaneously start executing without some trigger. If a program is not running it is not loaded into memory, it is just a file on the disk. How can a disk file load itself into memory and start running without an outside agent instructing it to do so? Steve T

                          1 Reply Last reply
                          0
                          • T Toni78

                            Christian is right. It is a little bit hard to interpret your question so I tried to guess. CreateProcess will launch the exe from within your code. ShellExecute too (this is easier to use but not recommended by Microsoft). It is impossible (a telepath would prove me wrong) to start a program without telling the computer to do so. Tom and Ravi gave you excellent answers when it comes to the exe being executed at startup without any user interaction. // Afterall, I realized that even my comment lines have bugs Time is the fire in which we burn.

                            T Offline
                            T Offline
                            Toni78
                            wrote on last edited by
                            #16

                            Toni78 wrote: ShellExecute too (this is easier to use but not recommended by Microsoft). Sorry, I meant to say WinExec, not ShellExecute. // Afterall, I realized that even my comment lines have bugs If the sun were to blow up, it would take us 7-8 minutes to realize it.

                            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