end task via command prompt

End Task/Force Kill App via Command Prompt (CMD) in Windows

In this guide, we will show you the steps to do an End Task aka force kill an app via Command Prompt on your Windows PC. The Task Manager beholds quite a few nifty features. These include the ability to check the background running processes, startup apps, CPU, RAM, and network consumption, details of running services, and many more. However, its most used scenario is when a user wants to force stop a running application that might be performing along the expected lines. But what if the Task Manager is itself not responding?

Well, that could really be the case and when that happens, things turn down for the worse. Granted, you could still reboot your PC and restore normalcy, however, you will first have to save all your pending works and then wait for the entire reboot process (for non-SSD users, this is even more challenging). So what else could be done? Well, you could also force kill or end task an app using Command Prompt on your Windows PC. And in this guide, we will show you how to do just that. Follow along.

End Task/Force Kill App via Command Prompt (CMD) in Windows

There exist two different methods to get this job done- using the file name or using its PID. We have listed both these methods below, you may refer to the one that is in sync with your requirement.

Method 1: Using Executable File Name

In this, you will need to know the executable file name for the app or process that you are about to kill. For example, in the case of OneDrive, it will be OneDrive.exe. If you aren’t sure of the name, then you could get it from the CMD window itself. All this has been explained below, check it out:

  1. Launch Command Prompt as an administrator and input the below command
    tasklist
  2. It will bring up the list of all the running apps and processes on your PC.
    end task via command prompt
  3. Note down the name of the app’s EXE file that you wish to force stop.
    end task via command prompt
  4. Then execute the below command to stop that app (make sure to replace EXEname accordingly)
    taskkill -im EXEname
  5. For example, in the case of OneDrive with EXEname OneDrive.exe, the above command will transform to:
    taskkill -im OneDrive.exe

    end task via command prompt

That’s it. This is how you could force kill or end task an app on your Windows PC using the Executable file name. Let’s now check out the second approach to do this task.

Method 2: Using PID

You could also use the app’s Process ID to force close an app via CMD. and you could get hold of this PID right from the Command Prompt itself. Here’s how both these tasks could be carried out:

  1. Launch Command Prompt as an administrator and input the below command
    tasklist
  2. It will bring up the list of all the running apps and processes on your PC.
    end task via command prompt
  3. Note down the app’s PID that you wish to force stop. It will be in the second column.
    end task via command prompt
  4. Now execute the below command to force close that app (make sure to replace processid accordingly)
    taskkill -pid processid
  5. For example, in the case of OneDrive, processid is 18724, so the above command will transform to:
    taskkill -pid 18724

    end task via command prompt

That’s it. These were the two different methods to force kill or end task an application via Command Prompt (CMD) on Windows. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.


About Chief Editor

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.