0

I am building a vb.net application which monitors external process and kills the process based on certain conditions. The application works great with monitoring .exe process but i m unable to use it with control pannel items.

Suppose a user launches programs and features , I want my vb.net app to detect it and kill it. Under task manager the process is shown as explorer.exe.

I can successfully launch programs and features using Process.Start(System.Environment.SystemDirectory + "\appwiz.cpl") but i cannot kill it this way, can anyone tell me how i could kill this process??

Thanks!

  • The program is only killed if a non-admin user is using the computer, its not a malware, its to prevent people from uninstalling important applications. – user5329357 Sep 12 '15 at 20:23

2 Answers2

0

You can use the following:

Process.Start("taskkill.exe /im explorer.exe")

Just replace explorer.exe with the process you wanna stop/kill...

Also works with the PID (Process ID):

Process.Start("taskkill.exe /pid /*yourPID*/")
cramopy
  • 3,459
  • 6
  • 28
  • 42
0

Do not kill applications until there is other way to exit them. It is like finishing your day by instantly turning off your computer.

First, at least ask applications to close themselves: Please see Microsoft article How to use Visual Basic .NET or Visual Basic 2005 to close another application how to implement closing request.

Also please have a look at this Q&A how to prevent application to be uninstalled by a user (w/o admin rights)?.

Community
  • 1
  • 1
miroxlav
  • 11,796
  • 5
  • 58
  • 99