Tuesday, December 17, 2024
HomeWindowsXP Pro and Vista: List active Windows programs from command line with...

XP Pro and Vista: List active Windows programs from command line with tasklist

The XP/Vista program tasklist runs from a command prompt and shows the programs currently running with a number of options. The ability to run commands from the command prompt allows automation with batch files. It is also often quicker to type a simple command to get specific output than to mouse through a series of menus.


To list all active programs running on the system, use:

tasklist

This shows each program running on one line and includes the PID (process ID) number, the memory usage, as well as the image (application) name.

Running taskkill with the verbose flag shows additional information including the user running the application, CPU execution time, and the title of the window:

tasklist /v

The tasklist command permits the use of numerous filters to view only certain applications. For example, to list only applications run by the user Quinn, use:

tasklist /FI "USERNAME eq Quinn"

Or, to list all applications currently running that have linked the DLL msvcrt.dll, use:

tasklist /FI "MODULES eq msvcrt.dll"

The following table shows the available filters and their use.

Filter Name Valid Operators Valid Value(s)
----------- --------------- --------------
STATUS eq ne RUNNING | NOT RESPONDING
IMAGENAME eq ne Image name
PID eq ne gt lt ge le PID value
SESSION eq ne gt lt ge le Session number.
SESSIONNAME eq ne Session name
CPUTIME eq ne gt lt ge le CPU time in the format
of hh:mm:ss.
MEMUSAGE eq ne gt lt ge le Memory usage in KB
USERNAME eq ne User name in [domain\]user
format
MODULES eq ne DLL name
SERVICES eq ne Service name
WINDOWTITLE eq ne Window title

eq: equals ne: not equal
gt: greater than lt: less than
gt: greater than or equal le: less than or equal

Quinn McHenry
Quinn McHenry
Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!