Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. Kill Command on Win 2K3

Kill Command on Win 2K3

Scheduled Pinned Locked Moved System Admin
helpquestion
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Its due when
    wrote on last edited by
    #1

    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

    L D 2 Replies Last reply
    0
    • I Its due when

      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

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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

      I 1 Reply Last reply
      0
      • L Lost User

        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

        I Offline
        I Offline
        Its due when
        wrote on last edited by
        #3

        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?

        L 1 Reply Last reply
        0
        • I Its due when

          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?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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 or Sc 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

          I 1 Reply Last reply
          0
          • L Lost User

            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 or Sc 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

            I Offline
            I Offline
            Its due when
            wrote on last edited by
            #5

            "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.

            R D 2 Replies Last reply
            0
            • I Its due when

              "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.

              R Offline
              R Offline
              raouls
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • I Its due when

                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

                D Offline
                D Offline
                DOSphantom
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0
                • I Its due when

                  "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.

                  D Offline
                  D Offline
                  DOSphantom
                  wrote on last edited by
                  #8

                  If you whant to dirctly call the kill command use system("kill blahblahbla"); command.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups