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. Database & SysAdmin
  3. System Admin
  4. Running an application automaticaly

Running an application automaticaly

Scheduled Pinned Locked Moved System Admin
windows-admintutorialquestion
6 Posts 3 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.
  • K Offline
    K Offline
    Kogee San
    wrote on last edited by
    #1

    Hello. Anyone here knows how to edit the registry of Windows XP so that one of my application can run automatically once windows startup? Im doing this for one of my final thesis project. Also, is there any options so that i can run the application background (hidden). My application doesnt have any GUI. Its just a win32 console application.

    J 1 Reply Last reply
    0
    • K Kogee San

      Hello. Anyone here knows how to edit the registry of Windows XP so that one of my application can run automatically once windows startup? Im doing this for one of my final thesis project. Also, is there any options so that i can run the application background (hidden). My application doesnt have any GUI. Its just a win32 console application.

      J Offline
      J Offline
      Johpoke
      wrote on last edited by
      #2

      There are a few different ways to make programs start with windows: 1. Registry 2. Startup folder 3. Service (can run before login) Depending on what you program does some methods may be better then others, for example if you have a computer critical driver then a service is nice. If its a utility which no one would want to disable the registry is nice, and if its a ad-don which someone might want to disable, then the startup folder is nice. 1. Registry: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run There are different places as you see, and if i remember correctly you can add it HKEY_LOCAL_MACHINE for it to start with all users or HKEY_CURRENT_USER for currently logged on user (but not sure) 2. Startup: C:\Documents and Settings\All Users\Start Menu\Programs\Startup C:\Documents and Settings\%USERNAME%\Start Menu\Programs\Startup This also has a per user setting, or global. Its a nice and very simple 3. Service: Services are the most reliable and most advanced, they can run before the user logs in, and keeps running when all users have logged out. If your application has no dialogs, then it shouldnt show anything no-matter how it starts, but if you use the registry or services (maybe even startup folder) then you can pass you own params to affect how your program starts. (but you will have to program them..) Choose which method would fit best to you application, then Google a bit on it, there is alot of info for all of them :)

      //Johannes

      K 1 Reply Last reply
      0
      • J Johpoke

        There are a few different ways to make programs start with windows: 1. Registry 2. Startup folder 3. Service (can run before login) Depending on what you program does some methods may be better then others, for example if you have a computer critical driver then a service is nice. If its a utility which no one would want to disable the registry is nice, and if its a ad-don which someone might want to disable, then the startup folder is nice. 1. Registry: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run There are different places as you see, and if i remember correctly you can add it HKEY_LOCAL_MACHINE for it to start with all users or HKEY_CURRENT_USER for currently logged on user (but not sure) 2. Startup: C:\Documents and Settings\All Users\Start Menu\Programs\Startup C:\Documents and Settings\%USERNAME%\Start Menu\Programs\Startup This also has a per user setting, or global. Its a nice and very simple 3. Service: Services are the most reliable and most advanced, they can run before the user logs in, and keeps running when all users have logged out. If your application has no dialogs, then it shouldnt show anything no-matter how it starts, but if you use the registry or services (maybe even startup folder) then you can pass you own params to affect how your program starts. (but you will have to program them..) Choose which method would fit best to you application, then Google a bit on it, there is alot of info for all of them :)

        //Johannes

        K Offline
        K Offline
        Kogee San
        wrote on last edited by
        #3

        So u mean that just add a new string value initiating the path of my application in the regedit to both HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run and the program will run automatically after startup? I think adding the registry would be the best choice since i dont want the user to disable my application. Anyway, thanks a lot. Really appreciate it.

        J D 2 Replies Last reply
        0
        • K Kogee San

          So u mean that just add a new string value initiating the path of my application in the regedit to both HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run and the program will run automatically after startup? I think adding the registry would be the best choice since i dont want the user to disable my application. Anyway, thanks a lot. Really appreciate it.

          J Offline
          J Offline
          Johpoke
          wrote on last edited by
          #4

          First i should say that i havent actually done this myself (but i have done it in regedit manually). I dont think you should add it to both of them, as then some(?) users might have two instances of the program running. Instead just add a new (i think its called)string into HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run and it will start for all users, both ones existing upon adding the string, and future accounts. Users can still (depending on rights) remove the startup via regedit or msconfig(or other programs like hijackthis). :)

          //Johannes

          K 1 Reply Last reply
          0
          • J Johpoke

            First i should say that i havent actually done this myself (but i have done it in regedit manually). I dont think you should add it to both of them, as then some(?) users might have two instances of the program running. Instead just add a new (i think its called)string into HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run and it will start for all users, both ones existing upon adding the string, and future accounts. Users can still (depending on rights) remove the startup via regedit or msconfig(or other programs like hijackthis). :)

            //Johannes

            K Offline
            K Offline
            Kogee San
            wrote on last edited by
            #5

            ok. i think i already got it by googling some issues that needs to be concerned also following your guide through your comment. I also need to find a way to write the registry by going through a service which could write the registry during my application is installed to the computer. My application is coded using VC++. Anyway, thanks a lot for ure help. Appreciated a lot.

            1 Reply Last reply
            0
            • K Kogee San

              So u mean that just add a new string value initiating the path of my application in the regedit to both HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run and the program will run automatically after startup? I think adding the registry would be the best choice since i dont want the user to disable my application. Anyway, thanks a lot. Really appreciate it.

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              If you put under the CURRENT USER key, then it will only run when the currently loggged in user logs in again. If it's put under the LOCAL MACHINE key, then it'll run whenever ANY user logs in.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007

              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