To kill a process in Windows 7 using Command prompt
Every one knows to kill a process in Windows using Task Manager Wizard.
Normally we are making use of ctrl+alt+del keys to show up the task manager wizard to kill the memory eating processor or "Not responding" process. Alternatively we can also make use of Windows command prompt to kill the process.
There are some more commands available like tasklist, tskill and taskkill and it can be used in command prompt.
"Tasklist" utility displays a list of programs/processes which are running in a local or remote machine with information like how much memory and CPU time is used by a process. It will also shows the session name and Process ID (PID) of each process. Each process is assigned with an unique number.
By default tasklist will show the Image Name, PID, Session Name, Session, Mem Usage (Kilo Bytes).
Using tasklist you can connect to a remote system to check for the running process and to kill the remote machine process.
tasklist /S remotesystemname will show the list of process running in the remote machine.
tasklist /V will show additional details like Status, CPU Time, and Window Title.
tasklist –FI "STATUS eq unknown" will show all the process with unknown as status.
tasklist /svc will list the service hosted in each process.
For more options on tasklist command check the help using tasklist /?
"Tskill" to kill the process based on the process name or processid which is running in a local machine or in a remote machine.
tskill notepad will kill all notepad opened in the system.
tskill 1783 will terminate the application which is running with process id 1783
tskill /SERVER:mytestserver notepad /A will terminate the notepad which is running on the server which is running in ALL sessions.
For more advanced options on tskill command check the help using tskill /?
"Taskkill" will terminate a process similar like tskill, but we can use Image Name or PID with filter option in a local machine or in a remote machine.
taskkill /IM notepad.exe will terminate the notepad.exe
taskkill /PID 2324 /PID 23444 /PID 3444 /T will terminate multiple PID and also its child processes which were started by the parent process.
taskkill /PID 2344 /F will forcefully terminate the process with process id 2344.
For more options on taskkill command check the help using taskkill /?
C:\Windows\system32>taskkill /IM K7AVScan.exe /f
ERROR: The process "K7AVScan.exe" with PID 6528 could not be terminated.
Reason: Access is denied.
What is the solution?