How to kill hanged program from command line [ Windows ]

Task Manager is one good place to kill program which hangs though you can make them auto kill but sometimes it’s not preferable and sometime even the task manager hangs. Here is a nifty trick which makes you to kill program from command line or windows dos.

Windows has two programs called as Taskkill and Tasklist. While one allows you to kill programs another lists all the programs running  Now you need both of them as taskkill needs a PID or Process ID of that program which can be found through tasklist. So lets give it a run ( Go to command prompt by typing cmd or command and then change to system32 folder windows or WINNT

Task List ( tasklist.exe )

task list for windows

Task Kill ( taskkill.exe)

taskill options

Here are the options for Task Kill

C:WINDOWSsystem32>taskkill /?

TASKKILL [/S system [/U username [/P [password]]]] { [/FI filter] [/PID processid | /IM imagename] } [/F] [/T]

This command line tool can be used to end one or more processes. Processes can be killed by the process id or image name.

Parameter List:
/F Specifies to forcefully terminate process(es).

/PID process id Specifies the PID of the process that has to be terminated.

/IM image name Specifies the image name of the process that has to be terminated. Wildcard ‘*’ can be used to specify all image names.

/T Tree kill: terminates the specified process and any child processes which were started by it.

There are more but you will need 2 of these max. Get the PID from Task List and then kill it forcefully using /F option or /T for child process. This is pretty neat way of killing programs and just needs 10 minutes of learning. Give it a try

About Ashish Mohta

A Professional Tech blogger, Editor and Writer who talks about solving day to day problems of people who use computer. His expertise are in Windows 7, Microsoft Office, Software, Mobile Apps and Video Posts.


  1. WOW…i was really in a big mess mate. Thank you, You’ve solved. Great work.


  2. nice post very useful it just help me make a quick bat worm remover

  3. Hi,
    In the Task Manager under application tab, the list of task needs to be displayed in command line. The command tasklist displays the process. But I require only the application tab details, also need the Image name under Process Tab.

    Is there a command to display the task name under application tab in command line

Leave a Reply