I am willing to bet that 90% of people who read this post will use Task Manager to force-quit a program if it’s not responding. I still do that, since it is the easiest to figure out.

However, I have my objections to Task Manager. It starts up ridiculously slowly, and by the time it’s launched, my program has either unfrozen or it has managed to close itself.

Command Prompt, on the other hand, always starts up in a flash because there’s really no GUI to load. It is however, a lot more daunting to use than Task Manager where you can select and press Delete to end a program.

That’s not to say it’s impossible for Command Prompt to have the same functions as Task Manager. Indeed, it would be ludicrous if Command Prompt couldn’t end processes. Fortunately, the commands aren’t too complicated. To view a list of currently running processes, type tasklist as shown:

command-tasklist

It’s basically a list of programs running, the numerical ID associated with it, and how much memory the program’s taking up. You may have to scroll up/down if you have lots of programs and/or background processes running.

To terminate a program is similar. Type:

 taskkill /F /IM [programName]

programName is a program from the ImageName column of the table. For example, to exit out of Firefox I would type

taskkill /F /IM firefox.exe

Explanation: The /F means “force”, /IM denotes that the command should look for an image name to terminate.

Other features

See that list of PIDs? Yes, you can terminate a program by its PID! (Side note: PID means Process ID. It’s a unique number assigned to each process.)

The syntax to end a process by its PID is:

taskkill /PID [id] /F

What’s also neat about taskkill is that you can terminate multiple processes just by replacing [id] with a space-separated list of all the PIDs you want to terminate. Example:

taskkill /PID 5872 2680 4520 6104 /F

Published by Geoffrey Liu

A software engineer by trade and a classical musician at heart. Currently a software engineer at Groupon getting into iOS mobile development. Recently graduated from the University of Washington, with a degree in Computer Science and a minor in Music. Web development has been my passion for many years. I am also greatly interested in UI/UX design, teaching, cooking, biking, and collecting posters.

One thought on “Kill processes via Command Prompt

Leave a Reply

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