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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. Stoping process

Stoping process

Scheduled Pinned Locked Moved System Admin
toolsquestion
10 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.
  • J Offline
    J Offline
    JCParker
    wrote on last edited by
    #1

    Dose any one have a short script that stops a running process after a short period of time? I have a misbehaving app which spawns processes and dose not always clean up. Thanks in advance Why do we grow up to become the people our parents warned us about?

    L 2 Replies Last reply
    0
    • J JCParker

      Dose any one have a short script that stops a running process after a short period of time? I have a misbehaving app which spawns processes and dose not always clean up. Thanks in advance Why do we grow up to become the people our parents warned us about?

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

      If you are running windows xp professional, try to use sc query /? command from the command prompt.

      T 1 Reply Last reply
      0
      • L Lost User

        If you are running windows xp professional, try to use sc query /? command from the command prompt.

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        sc command is for services only, not all processes...


        TOXCCT >>> GEII power

        [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

        J 1 Reply Last reply
        0
        • T toxcct

          sc command is for services only, not all processes...


          TOXCCT >>> GEII power

          [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

          J Offline
          J Offline
          JCParker
          wrote on last edited by
          #4

          Thanks for your input.

          1 Reply Last reply
          0
          • J JCParker

            Dose any one have a short script that stops a running process after a short period of time? I have a misbehaving app which spawns processes and dose not always clean up. Thanks in advance Why do we grow up to become the people our parents warned us about?

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

            JCParker wrote:

            Dose any one have a short script that stops a running process after a short period of time? I have a misbehaving app which spawns processes and dose not always clean up.

            Dim cProcesses, oProcess Set cProcesses = QueryWMI(sName,"root\cimv2","select * from win32_Process where name = '" & wscript.arguments.named("name") & "'","","") If Not IsObject(cProcesses) Then Wscript.Echo " *** Could not retrieve process (or process does not exist) on " & sName Else For Each oProcess In cProcesses On Error Resume Next oProcess.Terminate() If Err <> 0 Then Wscript.Echo " *** Error terminating on " & sName Wscript.Echo " " & Err.Description Else Verbose " Terminated on " & sName End If Next End If Give the correct process name. Then save the file with extension wsf (Exmaple: EndProc.wsf). Then go to the command line type the below command where the EndProc.wsf file reside: EndProc.wsf /computer:[YourComputerName] /name:[YourEndProcessName] Or you should look at the Kill command[^].

            J S 2 Replies Last reply
            0
            • L Lost User

              JCParker wrote:

              Dose any one have a short script that stops a running process after a short period of time? I have a misbehaving app which spawns processes and dose not always clean up.

              Dim cProcesses, oProcess Set cProcesses = QueryWMI(sName,"root\cimv2","select * from win32_Process where name = '" & wscript.arguments.named("name") & "'","","") If Not IsObject(cProcesses) Then Wscript.Echo " *** Could not retrieve process (or process does not exist) on " & sName Else For Each oProcess In cProcesses On Error Resume Next oProcess.Terminate() If Err <> 0 Then Wscript.Echo " *** Error terminating on " & sName Wscript.Echo " " & Err.Description Else Verbose " Terminated on " & sName End If Next End If Give the correct process name. Then save the file with extension wsf (Exmaple: EndProc.wsf). Then go to the command line type the below command where the EndProc.wsf file reside: EndProc.wsf /computer:[YourComputerName] /name:[YourEndProcessName] Or you should look at the Kill command[^].

              J Offline
              J Offline
              JCParker
              wrote on last edited by
              #6

              Thanks!

              L 1 Reply Last reply
              0
              • J JCParker

                Thanks!

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

                You are welcome :cool::rose:

                1 Reply Last reply
                0
                • L Lost User

                  JCParker wrote:

                  Dose any one have a short script that stops a running process after a short period of time? I have a misbehaving app which spawns processes and dose not always clean up.

                  Dim cProcesses, oProcess Set cProcesses = QueryWMI(sName,"root\cimv2","select * from win32_Process where name = '" & wscript.arguments.named("name") & "'","","") If Not IsObject(cProcesses) Then Wscript.Echo " *** Could not retrieve process (or process does not exist) on " & sName Else For Each oProcess In cProcesses On Error Resume Next oProcess.Terminate() If Err <> 0 Then Wscript.Echo " *** Error terminating on " & sName Wscript.Echo " " & Err.Description Else Verbose " Terminated on " & sName End If Next End If Give the correct process name. Then save the file with extension wsf (Exmaple: EndProc.wsf). Then go to the command line type the below command where the EndProc.wsf file reside: EndProc.wsf /computer:[YourComputerName] /name:[YourEndProcessName] Or you should look at the Kill command[^].

                  S Offline
                  S Offline
                  super_ttd
                  wrote on last edited by
                  #8

                  Roath Kanel wrote:

                  Or you should look at the Kill command[^].

                  ps, kill and such other commands are UNIX commands... :~ -- TTD --

                  L 1 Reply Last reply
                  0
                  • S super_ttd

                    Roath Kanel wrote:

                    Or you should look at the Kill command[^].

                    ps, kill and such other commands are UNIX commands... :~ -- TTD --

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

                    super_ttd wrote:

                    UNIX commands...

                    http://support.microsoft.com/?kbid=197155[^]

                    S 1 Reply Last reply
                    0
                    • L Lost User

                      super_ttd wrote:

                      UNIX commands...

                      http://support.microsoft.com/?kbid=197155[^]

                      S Offline
                      S Offline
                      super_ttd
                      wrote on last edited by
                      #10

                      APPLIES TO
                      • Microsoft Windows 2000 Server
                      • Microsoft Windows 2000 Advanced Server
                      • Microsoft Windows 2000 Professional Edition
                      • Microsoft Windows 2000 Datacenter Server
                      • Microsoft Windows NT Server 4.0 Standard Edition
                      • Microsoft Windows NT Workstation 4.0 Developer Edition
                      • Microsoft Windows NT Server 4.0, Terminal Server Edition

                      -- TTD --

                      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