-2

I have a problem. I have a GSM device and I wrote an application in C#. The app continuously receives SMSs and stores them in a database, but when Windows gets restarted, I have to explicitly login back to start the service again.

How can I be sure that my application starts automatically if Windows restarts?

2
  • 2
    You can configure Windows to automatically start any application you want when the user logs into their account. You can even configure Windows to automatically log into the account if you want.
    – Ramhound
    Aug 15, 2013 at 12:50
  • Which version of Windows? Aug 15, 2013 at 13:10

2 Answers 2

7

Write the program as a Windows service, instead of an application.

3
  • This won't launch it on full reboot on the logon screen. Aug 15, 2013 at 13:09
  • services launch regardless of login
    – Keltari
    Aug 15, 2013 at 13:29
  • OK, yes. You would have to write an interface application and a service if the current application is WinForms / WCF etc.. If he wants just the winform, then GINA or something would be required. Coffee still kicking in for the day. Aug 15, 2013 at 14:00
1

For Windows XP you can modify or use GINA, but this is not a simple thing to test!

http://www.codealias.info/technotes/custom_pre-logon_processing_in_ms_windows_using_gina_hooks

For Windows 7 the process has changed, but still, there is a better method for most situations:

Use Sysinternals and either Autologon or TweakUI to autologon.

Then add the application to the startup applications.


Edit

The above for is for trying to run a pure application, as Keltari pointed out the alternative is to make the application a service.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .