4

I should get the number of active processes and active threads running in my server or computer using command-line.. I don't want to list all the processes or threads running, I need them in numbers.

2 Answers2

9

Using PowerShell, the following two commands will get that information:

Number of processes running:

(Get-Process).Count

Number of threads running:

(Get-Process|Select-Object -ExpandProperty Threads).Count
harrymc
  • 498,455
3

You could use PowerShell for this.

To get a list of all active processes on the local computer, use this command.

Get-Process | Measure

No of Active Processes

You can also filter these results. For example, see the below code.

Get-Process winword, explorer | Measure

No of Active Processes - Filter

To get no of threads, run this command.

Get-Process | Select-Object -ExpandProperty Threads | Measure

No of Threads


To use these command in Command prompt, simply do this.

PowerShell -Command "Get-Process | Measure"
PowerShell -Command "Get-Process | Select-Object -ExpandProperty Threads | Measure"
PowerShell -Command "Get-Process | Select-Object -ExpandProperty Threads | Measure"


Resources
- Get-Process
- Measure-Object
- Select-Object
DxTx
  • 1,276