Kill process that doesn't show up in task manager

I am able to kill running processes which show up in the task manager but there are some games like KnightOnline and Metin2 that don't show up in task manager and so I can't kill them. I've been searcing for a solution but couldn't find. This is an internet cafe software and I just want to close all programs and games when a customer leaves so that the new customer will have a fresh desktop.

As windows automaticly closes everything, I thought of ending the session and reloging but that doesn't seem to be easy and not the best way.

Waiting for your valuable comments


Use ProcessExplorer - http://technet.microsoft.com/en-us/sysinternals/bb896653 to check all processes and close what you want. It should show you every application on every account -if you have administrator rights of course.

To kill it programatically check this post: https://stackoverflow.com/questions/1642231/how-to-kill-a-c-process

When you don't know name of process, but you know name of executable that is run on your computer ( C:...\Metin.exe) then you can iterate through all processes and search for process that in list of loaded modules (Modules property) has module with name of your executable (FileName property in ProcessModule class) . Maybe it helps.


If you can't find your application in the Applications tab then in the Task Manager switch to the second tab "Processes" find your desired application process then press "End Process", normally all processes have names similar to their applications, see the image below:

Steps


From a command line do

"tasklist | more"

pay attention to the PID (for instance 123)

to kill the item do

"taskkill /f /pid 123"

The benefit is that these commands also work on remote systems.

"tasklist /s <systemname> /u <domain>\<user>"

same for taskkill


There is Kill method in Process. You may use it in such way:

var procs = System.Diagnostics.Process.GetProcesses(); // Get all processes in the system
procs[0].Kill();

There is also GetProcessesByName method with help of wich you can obtain pricesses by their names:

var procs = System.Diagnostics.Process.GetProcessesByName("firefox");