CodeSteps

Python, C, C++, C#, PowerShell, Android, Visual C++, Java ...

Windows : Display running processes from command prompt (using TASKLIST.EXE)

Windows Task Manager shows the list of processes currently running in the System. Not only the processes, it also displays the list of Services that are registered in the Windows Operating System.

We can display the list of processes & services from the command prompt also, and especially these are helpful when we are writing the scripts to manage the processes and services.

Windows Operating System provides the TASKLIST.EXE tool to list the processes & services from the command prompt.

We do have several tools, to display the list of processes & services currently running from the command prompt. In this article, I would like to explain TASKLIST.EXE.

From the command prompt, run TASKLIST.EXE; to display the list of processes or services currently running in the System.

Type the tasklist at the command prompt & it displays the list of processes currently running. The output looks like the below:

C:\>tasklist

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
System Idle Process              0 Services                   0         24 K
System                           4 Services                   0      4,336 K
smss.exe                       468 Services                   0      1,328 K
...
...
cmd.exe                      10404 Console                    1      3,868 K
taskmgr.exe                   3604 Console                    1     12,048 K
taskeng.exe                   7424 Console                    1      6,788 K
tasklist.exe                 11000 Console                    1      6,464 K

C:\>

We can even display the list of services currently running. By using the “/SVC” switch at the command prompt, we can display the list of services associated with the processes. Type “tasklist /svc” at the command prompt. The output looks like the below:

C:\>tasklist /svc

Image Name                     PID Services
========================= ======== ============================================
System Idle Process              0 N/A
System                           4 N/A
smss.exe                       468 N/A
...
lsass.exe                      964 KeyIso, Netlogon, SamSs
svchost.exe                   1076 AudioEndpointBuilder, CscService, Netman,
                                   PcaSvc, SysMain, UxSms, Wlansvc, wudfsvc
svchost.exe                   1100 EventSystem, FontCache, netprofm, nsi,
                                   SstpSvc, W32Time, WdiServiceHost,
                                   WinHttpAutoProxySvc
svchost.exe                   1152 AeLookupSvc, BDESVC, BITS, CertPropSvc,
                                   EapHost, gpsvc, hkmsvc, IKEEXT, iphlpsvc,
                                   LanmanServer, ProfSvc, RasMan, Schedule,
                                   SENS, ShellHWDetection, Themes, Winmgmt
stacsv64.exe                  1188 STacSV

 

Observe that, the list of services associated with the processes is displayed under the “Services” column.

We can even apply a filter to verify whether the application is currently running.

For example: to verify whether “chrome.exe” is running; you can type the below command.

C:\>tasklist /fi "imagename eq chrome.exe"

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
chrome.exe                    1948 Console                    1    165,936 K
chrome.exe                    9052 Console                    1     34,452 K

C:\>

Where “/fi” is the switch used to filter the list of tasks on certain conditions. The condition should be in double quotes (“) and “eq” or “ne” are the operators, we can use for equal or non-equal checks respectively. The “imagename” is the filter name we can use, to filter the tasks or processes based on the name.

To know the list of processes or tasks using memory > Size (for example 100 MB), the filter looks like the below:

/fi “memusage gt 102400”

when we use the “memusage” filter, the memory value we need to specify in KBs. So 100 MB = 102400 KB. The result looks like the below:

C:\>tasklist /fi "memusage gt 102400"

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
svchost.exe                   1076 Services                   0    244,776 K
chrome.exe                    1948 Console                    1    166,408 K

C:\>

Even we can find out the list of processes that are not responding, by using the below command.

C:\>tasklist /fi "status eq not responding"

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
jusched.exe                   6576 Console                    1     11,444 K

C:\>

If you like this Article, post your comments in the Comments section. See also, “How to kill Windows process from command prompt?“.

🙂 Sahida.

Windows : Display running processes from command prompt (using TASKLIST.EXE)

3 thoughts on “Windows : Display running processes from command prompt (using TASKLIST.EXE)

  1. Pingback: My Homepage

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top