I want to run C# program when login screen appears


  1. Posts : 1
    windows 7 home premium 32bit
       #1

    I want to run C# program when login screen appears


    I want to run C# program when login screen appears.
    I will explain it

    e-g there is no one sitting on my computer and my computer suddenly restarts and I want to run mine program which is very important all I want is that that program will run in background weather someone login the computer or not.

    That program should be independent of user login.

    Can anyone help me please
      My Computer


  2. Posts : 17,796
    Windows 10, Home Clean Install
       #2

    I think that we can help using this great tutorial
    Task - Create to Run a Program at Startup and Log On
      My Computer


  3. Posts : 2,468
    Windows 7 Ultimate x64
       #3

    Services are designed to do exactly that job. If you can turn your program to run as a service then that will fulfill your whole requirements.

    In short, services are just normal programs with a special interface to the OS. They can be started at system start before the user logins and keep running indefinitely irrespective of any login/logoff. Services are completely background processes, without any kind of user interface at all.

    If you have the chance of modifying the program, then making it into a service should be relatively easy. For C#, look at the ServiceBase class, make a subclass of it then call your original code from it.

    If you can't change the program at all you may use a wrapper program and have it run yours. A good option is NSSM.

    In any case, once your program is installed as a service you can manage it like any standard Windows service using control panel.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:30.
Find Us