Solved

Application to end processes automatically

Posted on 2008-10-08
2
215 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
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
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 …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

786 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