windows service scheduler
-
using .net 2.0, Is it possible to schedule the windows service manually (i.e. from services window under control panel) or do I have to implement a timer inside the service i.e. in the code? Currently I have scheduled the service to run on weekdays at 7:00 AM. This is done by having a timer in the code window. Is there a way to do the same thing manually? i.e. is there a scheduled job window to set the time, days, etc...? Thanks
-
using .net 2.0, Is it possible to schedule the windows service manually (i.e. from services window under control panel) or do I have to implement a timer inside the service i.e. in the code? Currently I have scheduled the service to run on weekdays at 7:00 AM. This is done by having a timer in the code window. Is there a way to do the same thing manually? i.e. is there a scheduled job window to set the time, days, etc...? Thanks
arkiboys wrote:
Is there a way to do the same thing manually? i.e. is there a scheduled job window to set the time, days, etc...?
Go to Control Panel -> Scheduled Tasks -> Add Scheduled Task :rose:
-
arkiboys wrote:
Is there a way to do the same thing manually? i.e. is there a scheduled job window to set the time, days, etc...?
Go to Control Panel -> Scheduled Tasks -> Add Scheduled Task :rose:
-
Choose the service which you want to schedule. :confused:
-
Choose the service which you want to schedule. :confused:
-
Dude, Even Windows Service is an .exe file with no interface. Browse to the folder where you have installed or created that.
-
Dude, Even Windows Service is an .exe file with no interface. Browse to the folder where you have installed or created that.
-
Dude, Even Windows Service is an .exe file with no interface. Browse to the folder where you have installed or created that.
I have set the scheduler but it gives an error: can not start service from the command line or a debugger. A windows service must be installed (using installutil.exe)...) Please note that I have installed it correctly. If I start the service in the control panel/services, then the service runs but I do not want to start it manually. I now want the service to run based on the scheduled task. Thanks
-
I have set the scheduler but it gives an error: can not start service from the command line or a debugger. A windows service must be installed (using installutil.exe)...) Please note that I have installed it correctly. If I start the service in the control panel/services, then the service runs but I do not want to start it manually. I now want the service to run based on the scheduled task. Thanks
You cannot run the exe and expect the windows service to start. Please wipe that idea off. Create a batch file with the following line
net start yourservice
Again this assumes that the service is already installed and is in System32. If not you've to navigate to the path where your exe is and run the above command.cd your path net start yourservice
You can then schedule this batch file to run at any desired time. The downside is that you need to stop the service manually too, so that it does not error out in the next scheduled start. So another batch file, another scheduled task which runs after your start task.net stop yourservice
Above all, I thought the whole point in creating a windows service was to do something constantly in the background. I reccomend putting in that timer in your service.SG
-
using .net 2.0, Is it possible to schedule the windows service manually (i.e. from services window under control panel) or do I have to implement a timer inside the service i.e. in the code? Currently I have scheduled the service to run on weekdays at 7:00 AM. This is done by having a timer in the code window. Is there a way to do the same thing manually? i.e. is there a scheduled job window to set the time, days, etc...? Thanks
You can create a batch file with the following line
net start _serviceName_
and schedule it to run when you want. Replace the serviceName with the name of the service. If you are not sure what the name of the service is you can runnet start
from the command line to get a list of services. You can also schedulenet stop _serviceName_
to stop the service. As an alternative, I wrote a replacement for the Windows Scheduler application, that allows you to write your own .NET assemblies to schedule.Here are some of my articles. Hope this helps! Joseph Guadagno http://www.josephguadagno.net