Kill Command on Win 2K3
-
Hi everyone, Im running a service control program that specifically pauses and resumes services at a particular time of day. This program has been implemented with a kill function that calls the "kill.exe" to kill a service if it has not reached a specific state within a specified time. This program is run as part of a scheduled task. I've noticed that the kill does not seem to be going through when it is run as a schedule task, however if I log on and run the task manually it works just fine and the kill is implemented if need be. So I guess my question is this, is there an issue with win 2k3 not being able to execute a kill command unless a user is logged on? If this is the problem is there anyway around it? Any help would be greatly appreciated. Thanks
-
Hi everyone, Im running a service control program that specifically pauses and resumes services at a particular time of day. This program has been implemented with a kill function that calls the "kill.exe" to kill a service if it has not reached a specific state within a specified time. This program is run as part of a scheduled task. I've noticed that the kill does not seem to be going through when it is run as a schedule task, however if I log on and run the task manually it works just fine and the kill is implemented if need be. So I guess my question is this, is there an issue with win 2k3 not being able to execute a kill command unless a user is logged on? If this is the problem is there anyway around it? Any help would be greatly appreciated. Thanks
-
Try to use AT command[^] instead of task schedule.
A thousand mile of journey, begin with the first step. APO-CEDC Save Children Norway-Cambodia Office
Thanks for the info but still doesnt seem to work. Its weird cause when the pause and resuming of services works then there is no problem. Its only an issue if the service takes too long to reach the desired state that the issues arise. The way ive coded it tells the app to kill the service if it has not reached the desired state within a specified amount of time. Running the app on various other machines works fine and even works fine when running the app manually on the win 2k3 box. Its only when it runs as a batch process do the issues arise. Any other ideas?
-
Thanks for the info but still doesnt seem to work. Its weird cause when the pause and resuming of services works then there is no problem. Its only an issue if the service takes too long to reach the desired state that the issues arise. The way ive coded it tells the app to kill the service if it has not reached the desired state within a specified amount of time. Running the app on various other machines works fine and even works fine when running the app manually on the win 2k3 box. Its only when it runs as a batch process do the issues arise. Any other ideas?
Its due when wrote: Its weird cause when the pause and resuming of services works then there is no problem Can you tell me, what is the command that you use to start/stop/pause the service?
Net start/stop
orSc query
command? Its due when wrote: The way ive coded it tells the app to kill the service if it has not reached the desired state within a specified amount of time If it is possible, could you post some piece of your code on this forum?
A thousand mile of journey, begin with the first step. APO-CEDC Save Children Norway-Cambodia Office
-
Its due when wrote: Its weird cause when the pause and resuming of services works then there is no problem Can you tell me, what is the command that you use to start/stop/pause the service?
Net start/stop
orSc query
command? Its due when wrote: The way ive coded it tells the app to kill the service if it has not reached the desired state within a specified amount of time If it is possible, could you post some piece of your code on this forum?
A thousand mile of journey, begin with the first step. APO-CEDC Save Children Norway-Cambodia Office
"Can you tell me, what is the command that you use to start/stop/pause the service? Net start/stop or Sc query command?" - I've written my own start/stop/pause resume command. This was primarily based on the article and code from http://www.microsoft.com/msj/0298/service.aspx[^] The "kill" function is just a call to the "kill.exe" NT resource utility and is activated by a simple if statement specifying a timeout period.
-
"Can you tell me, what is the command that you use to start/stop/pause the service? Net start/stop or Sc query command?" - I've written my own start/stop/pause resume command. This was primarily based on the article and code from http://www.microsoft.com/msj/0298/service.aspx[^] The "kill" function is just a call to the "kill.exe" NT resource utility and is activated by a simple if statement specifying a timeout period.
have you checked what user the schedule runs as, and if that user has permissions to run the kill command? -- Raoul Snyman Saturn Laboratories e-mail: raoul.snyman@saturnlaboratories.co.za web: http://www.saturnlaboratories.co.za/ linux user: #333298
-
Hi everyone, Im running a service control program that specifically pauses and resumes services at a particular time of day. This program has been implemented with a kill function that calls the "kill.exe" to kill a service if it has not reached a specific state within a specified time. This program is run as part of a scheduled task. I've noticed that the kill does not seem to be going through when it is run as a schedule task, however if I log on and run the task manually it works just fine and the kill is implemented if need be. So I guess my question is this, is there an issue with win 2k3 not being able to execute a kill command unless a user is logged on? If this is the problem is there anyway around it? Any help would be greatly appreciated. Thanks
Well you could use signals from the signal.h that will mean manule sending a sig. And I think the kill command is a admin only command I think. You could trie to some how create your own kill function by scratch whitch will take more time.
-
"Can you tell me, what is the command that you use to start/stop/pause the service? Net start/stop or Sc query command?" - I've written my own start/stop/pause resume command. This was primarily based on the article and code from http://www.microsoft.com/msj/0298/service.aspx[^] The "kill" function is just a call to the "kill.exe" NT resource utility and is activated by a simple if statement specifying a timeout period.
If you whant to dirctly call the kill command use system("kill blahblahbla"); command.