Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kill Processes Automatically as Soon as it Start in Windows

I am using a software which automatically starts a processes called "browser.exe" in huge quantity. I want to kill all "browser.exe" processes automatically. Currently i have created a shortcut using below code to kill the "browser.exe" processes on click, but we have to do it manually.

taskkill.exe /F /IM browser.exe /T

Is there any way or code so that the processes "browser.exe" get automatically killed as soon as they start?

like image 678
Rahul Mukati Avatar asked Nov 18 '25 05:11

Rahul Mukati


1 Answers

A simple VB (or other) script should do the trick. For example:

set service = GetObject ("winmgmts:")
Dim oShell : Set oShell = CreateObject("WScript.Shell")

Do While 11>10
for each Process in Service.InstancesOf ("Win32_Process")
If Process.Name = "browser.exe" then
' Kill the process '
oShell.Run "taskkill /im browser.exe", , True
End If
next
' pause for 60 sec '
WScript.Sleep 60000
Loop

Then just have the script launch at startup and it will attempt to kill all browser.exe processes every 60 sec (or whatever interval you choose) if it is running.

This should require very little processor time, so as long as you loop on the scale of seconds (rather than milliseconds), this should have no noticeable effect on your system.

Though I've been wrong before. :)
like image 123
tonip Avatar answered Nov 20 '25 18:11

tonip



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!