views:

88

answers:

3

I developed a chat application with an attendant chat server. Everything is working fine. The issue now is the fact that whenever the chat server goes down (for instance, the server system shuts down as a result of power failure or some other problem), by the time the server system come back on, the chat server would have to be restarted manually.

I believe (and I know) it is more appropriate for the chat server application to restart itself when the computer comes back on (and of course regardless of who is logged in and of course, even before anyone logs in). I have a batch file that executes the chat server. My attempt was to create a windows service that start automatically and runs this batch file using a Network Service account on the server system. Although, I'm having a hard time with this (temporarily), I would love to ask if there are any alternatives to using a windows service. Suggestions are highly appreciated.

+1  A: 

Creating a windows service will be the better solution, but you can add your batch file into the startup folder.

CD
The issue with adding the batch file to the startup folder is that it is dependent on a user logging in and I do not want that.
A: 

I think you are already having the better solution (Wibndows Service). Along with adding an email alert or some sort of alert when the server restarts will be handy (?).

Shoban
I created a windows service using VB.NET and in the onStart method, I tried to call the batch file using the Process.Start() and even Shell() but when I start the service, that batch file is not executed. I just don't understand why. Any ideas?
ok.. Try running the scheduled task manually and see what is the result. it will tel you why the task is not run.
Shoban
A: 
Joey