Tuesday, January 10, 2012

Check if application is running via command line (in Windows)

You are probably familiar with Task Manager in Windows. It is very useful for seeing what processes are running. Wouldn’t it be great if there was a command line tool that did the same thing. As it turns out, there is one that is built into Windows. It is called tasklist. It is very easy to use.

In its simplest usage just type tasklist at the command prompt. You will get a list very much like the Processes tab in Task Manager.

The cool thing is it has filtering built in. For example, if you just wanted to see the notepad processes you could do something like: tasklist /FI "IMAGENAME eq notepad.exe"

Type tasklist /? to get a details on the other options you have. There are lots of them. You can specify a remote system, list all tasks currently using a exe or dll, display services hosted in each process, format output as a table, list, or csv, use other filters, turn off headers, etc.

Very nice little tool to have.

1 comment:

steveo said...

very cool. You've got some really good posts. Gonna have to start following more of what you have to say here...