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#
  4. autostart c# winApp upon system boot

autostart c# winApp upon system boot

Scheduled Pinned Locked Moved C#
csharpquestion
12 Posts 9 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.
  • V Vasudevan Deepak Kumar

    Lot of ways... (*) You can have a shortcut to the application in the Users->Startup folder in STart Menu or (AllUsers -> Startup folder, to affect all users. I think for the latter you need to have Administrative Privileges on the system). (*) You can have a entry in HKLM->Sofware->Microsoft->Windows->CurrentVersion->Run (*) You can configure your application as a Windows Service itself. Developing a Windows Service in C# and deploying them is a breeze. A lot of samples anyway. I think the first two are logon based. Some user should logon for the app to launch. The latter, by virtue of being a Windows Service, would start immediately on system boot. Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://deepak.blogdrive.com/

    B Offline
    B Offline
    batmanAgen
    wrote on last edited by
    #3

    thanks for the immediate response.:) when i will develop a windows service, is it possible to have a method from the service that will call a c# windows app to run? i need this because i need to generate message prompts to the users in the network... i know with the other two methods, i can do this, but im not sure if it can be done using windows service and another c# app. tnx

    M 1 Reply Last reply
    0
    • B batmanAgen

      thanks for the immediate response.:) when i will develop a windows service, is it possible to have a method from the service that will call a c# windows app to run? i need this because i need to generate message prompts to the users in the network... i know with the other two methods, i can do this, but im not sure if it can be done using windows service and another c# app. tnx

      M Offline
      M Offline
      mav northwind
      wrote on last edited by
      #4

      I think you can run an application from a service, but usually the service will not have the right to interact with the desktop, so expect your WindowsForms application to crash as soon as it tries to open a window. Regards, mav

      E 1 Reply Last reply
      0
      • M mav northwind

        I think you can run an application from a service, but usually the service will not have the right to interact with the desktop, so expect your WindowsForms application to crash as soon as it tries to open a window. Regards, mav

        E Offline
        E Offline
        engsrini
        wrote on last edited by
        #5

        What about the autoexec.bat file :^)

        M M 2 Replies Last reply
        0
        • E engsrini

          What about the autoexec.bat file :^)

          M Offline
          M Offline
          mav northwind
          wrote on last edited by
          #6

          You mean placing a call to a .NET application inside autoexec.bat? :omg: One word: Don't. The solutions given so far are about the only options you have available. First you have to decide whether you want your program to run when the system is started (then use a service) or if you want it to run when a user logs in (then you can use the other two methods). But nevertheless, for a windows service to run nobody has to be logged on so you usually don't have a desktop to perform user interaction with. You _can_ allow a service desktop interaction, though. But allowing this is usually considered bad style. Regards, mav

          1 Reply Last reply
          0
          • E engsrini

            What about the autoexec.bat file :^)

            M Offline
            M Offline
            malharone
            wrote on last edited by
            #7

            engsrini wrote:

            What about the autoexec.bat file

            :wtf::wtf::wtf: The solution suggested to use registry seems proper. Everything else is a hack! - Malhar

            D 1 Reply Last reply
            0
            • B batmanAgen

              hi guys, i need to autostart my c# windows application upon boot time of the pc. is it possible using windows service? if not, what are other ways of doing it? tnx...:)

              D Offline
              D Offline
              drc_no1
              wrote on last edited by
              #8

              if i remember well, if u add your program to program files/startup, it will start once with windows...

              D 1 Reply Last reply
              0
              • D drc_no1

                if i remember well, if u add your program to program files/startup, it will start once with windows...

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

                Noooooo, it will start when the user logs in, not when Windows starts. There is a HUGE difference. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                D 1 Reply Last reply
                0
                • M malharone

                  engsrini wrote:

                  What about the autoexec.bat file

                  :wtf::wtf::wtf: The solution suggested to use registry seems proper. Everything else is a hack! - Malhar

                  D Offline
                  D Offline
                  Daniel Grunwald
                  wrote on last edited by
                  #10

                  You can also try to - use Win.ini (from good Win 3.11 times) - write a Windows Explorer extension that starts your application - replace a process used by the system with a modified version. On XP, you need to disable system restore for this. - find more strange autostart locations

                  D 1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    Noooooo, it will start when the user logs in, not when Windows starts. There is a HUGE difference. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                    D Offline
                    D Offline
                    drc_no1
                    wrote on last edited by
                    #11

                    yup, u'r right... my mistake... if u want, u can mess with the boot section and make it be a win service that starts when windows starts...

                    1 Reply Last reply
                    0
                    • D Daniel Grunwald

                      You can also try to - use Win.ini (from good Win 3.11 times) - write a Windows Explorer extension that starts your application - replace a process used by the system with a modified version. On XP, you need to disable system restore for this. - find more strange autostart locations

                      D Offline
                      D Offline
                      Dan Neely
                      wrote on last edited by
                      #12

                      Daniel Grunwald wrote:

                      - replace a process used by the system with a modified version. On XP, you need to disable system restore for this.

                      This solution will break on 64 bit windows. To stymie rootkit authors it'll no longer be possible to replace/modify OS runtime files without convincing MS you can't do it any otehr way and getting them to digitally sign your files.

                      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