Command Prompt Computer Tips Tricks Useful

Stop a Not Responding Program by command prompt

In our day-to-day life we come across many situations when some of our applications go to not responding state. In that situations we may have two options. The first option is, the application may automatically come to normal state after some time and the second is, it may take too much time to become normal. In the second case we may want to forcibly terminate the program which has gone not responding.

Generally we open task manager to terminate a program when it becomes not responding. But here I am going to show you two useful tricks to terminate a Not Responding program using command prompt.

First trick

  • Open command prompt and type tasklist
  • After you press enter all the tasks will be listed out in the command prompt with their names and PID.
  • Then to terminate a program type Taskkill /PID <PID> /F 
  • Mention the value of your PID in place of the angular brackets
  • Here is an example I am going to show you
  • Suppose following programs are open in your computer out of which the firefox got Not Responding.
Task List in command prompt 
  • Then to terminate the firefox we have to write the following command in command prompt.
  • Taskkill /PID 796 /F

    Second trick

    In the second trick I will tell you how to create a batch file which will list out all the running tasks. To terminate a program just you need to enter the PID and press enter.
    Just copy and paste the following code in a notepad and save it in .bat extension
    @ echo off
    set /p pid=ENTER PID TO TERMINATE:
    Taskkill /PID %pid% /F
    Goto begin
    After you save it just double click to open the file and mention the PID to terminate a program.

    You may also like to see some more command prompt tricks