Categories
Development

List and Kill

Photo by Andras Vas on Unsplash

We were testing a console application run using Windows Task Scheduler on Windows Server.

The application started logging funnily on a loop.

We had to stop it to debug and troubleshoot.

It was not possible to stop a running application from Windows Task Scheduler.

The application was not visible on Windows Task Manager for some reason.

How do you stop the application?

My colleague at work came up with two beautiful commands that I had not used before – “tasklist” and “taskkill”!

Step 1:

Command: tasklist

Get the list of tasks running on the machine. Identify the application to be stopped and note the PID of the application say 8021

Step 2:

Command: taskkill /pid 8021

Kill the task with the specified PID

I just loved the simplicity of the these two commands and added them mentally to my toolbox.

Do you have it in your toolbox?

Reference:

tasklist | Microsoft Docs

taskkill | Microsoft Docs