Solved

Application to end processes automatically

Posted on 2008-10-08
2
217 Views
Last Modified: 2012-05-07
Is there an applicatin that will automatically end a specific process when it starts running?

This would be used on a server 2003 R2 32-bit box.
0
Comment
Question by:itiadmin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Expert Comment

by:corstiaan_haaij
ID: 22672952
What kind of process you will kill automatically?
When it is a Windows process, there is possible a service.
0
 
LVL 38

Accepted Solution

by:
Shift-3 earned 500 total points
ID: 22672979
You could use a vbscript like the one below.


'Adapted from http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct06/hey1004.mspx
arrProcesses = Array("freecell.exe","sol.exe","spider.exe","winmine.exe")
 
strComputer = "."
 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
 
i = 0
 
Set colMonitoredProcesses = objWMIService. ExecNotificationQuery _        
    ("Select * From __InstanceCreationEvent Within 5 Where TargetInstance ISA 'Win32_Process'")
 
Do While i = 0
    Set objLatestProcess = colMonitoredProcesses.NextEvent
    strProcess = LCase(objLatestProcess.TargetInstance.Name)
 
    For Each strName in arrProcesses
        If strName = strProcess Then
            objLatestProcess.TargetInstance.Terminate
        End If
    Next
Loop

Open in new window

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question