ofloflofl
ofloflofl

Reputation: 205

how to display the CPU percentage usage by each process in cmd

i want to a cmd windows command to display the all the processes and the cpu percentage for each process. is there a command which give me this result? can you help me please? thank you

Upvotes: 4

Views: 18121

Answers (2)

Matthew Lundberg
Matthew Lundberg

Reputation: 42629

Perfmon can use a wildcard to get the CPU usage for each running process. It also has the text interface typeperf which spits the results out to the console.

This command will produce a one-line CSV output of the current running process CPU usage:

typeperf "\process(*)\% processor time" -sc 1

The PID is missing from this report. If you need, you can add the PID for each of the processes as a separate counter to log, then match up the names:

typeperf "\process(*)\% processor time" "\process(*)\id process" -sc 1

Upvotes: 1

AlexDev
AlexDev

Reputation: 4717

Try pslist from the SysInternals-powered pstools.

You will need to download them from that link and put the tools in your cmd directory (or chdir to wherever they are).

Use -s to see the CPU usage of each process.

Upvotes: 4

Related Questions