October 11, 2010

Text Mode Task Manager

Filed under: Main — admin @ 12:01 am

Here’s a really nerdy blog post for you: There is a command line version of the Windows Task Manager. Unlike the Task Manager window, with all its graphical fun and folly, the command line task manager is all about business.

To start a command prompt window, from the Start menu choose All Programs, Accessories, Command Prompt.

Though it appears in a graphical window, the command prompt is all about text mode operations for a computer, just as it was back in the old days. In fact, you can run your entire Windows computer from the command prompt. I know quite a few hardcore nerds who do just that.

The Task Manager command is tasklist. When you type tasklist and press Enter, you’ll see a long, long list of all the tasks, processes, and such that are going on inside your computer.

The list that the tasklist command outputs is meaningless by itself, but there are ways to manipulate the tasklist command so that it displays more useful information.

tasklist /fi "status eq running"

The above command displays a list of only those running tasks.

tasklist /svc

The above command displays a list of running services.

tasklist /m /fi "imagename eq cmd.exe"

The above command displays a list of modules used by a specific task, in this case the command prompt itself.

tasklist /m /fi "imagename eq rundll32.exe"

The above command displays the many things that the rundll32.exe task does, which is quite a few in Windows Vista.

tasklist /fi "cputime gt 00:00:30"

The above command lists all the tasks that have been consuming more than 30 seconds of processing time. In other words, it lists the busy tasks.

tasklist /fi "imagename eq svchost.exe"

The above command lists all the different instances of the svchost.exe process, which is always quite a few in WIndows.

You can’t use the tasklist command to kill off a task, but you can use the taskkill command. Both command work together, one supplying information that can be used for the other.

For example, to close your command prompt window, type this command at the prompt:

taskkill /f /im cmd.exe /t

Poof! The window closes because the cmd.exe task, which is what’s running the command prompt, is summarily executed.

There’s a lot more than can be done with the command prompt than most users realize. Like I said, it’s a great way to run your computer.

2 Comments

  1. Umm just tried the tasklist command it came back with
    “‘tasklist’ is not recognized an internal or external command, operable program or batch file”, is it a Win7 or Vista thing as I’m running WinXP (upto date SP’s) and am an Adminstrator….
    I was thinking DOS shell running it?.
    Glenn

    Comment by glennp — October 11, 2010 @ 2:08 am

  2. You’re correct in your observation, Glennp: It’s a new command with Windows Vista. Windows XP doesn’t have the tasklist command. I should have been more clear in the article.

    Comment by admin — October 11, 2010 @ 8:34 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.


Powered by WordPress