4

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

ofloflofl
  • 205
  • 3
  • 6
  • 12
  • Possible duplicate of [How to convert a tasklist's CPU time to CPU % usage?](https://stackoverflow.com/questions/206805/how-to-convert-a-tasklists-cpu-time-to-cpu-usage) – TylerH Oct 03 '18 at 16:05

2 Answers2

4

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.

TylerH
  • 20,799
  • 66
  • 75
  • 101
AlexDev
  • 4,049
  • 31
  • 36
  • 1
    Hi, you can run "pslist -s 1" it will run for a second and exit, without updating. – AlexDev Aug 21 '13 at 11:28
  • this number is the percentage cpu or the cpu time? – ofloflofl Aug 21 '13 at 11:43
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/35912/discussion-between-alexdev-and-ofloflofl) – AlexDev Aug 21 '13 at 11:45
  • Very nice! However my server is virtually seized, I have like 100 CPU cycles to work with, literally! `tasklist` takes ages to run. So downloading and installing is not an option ATM. I will remember to do so after I resolve this CPU hog problem, if I ever do. Thank you. – Rolf Nov 09 '17 at 13:22
1

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

Matthew Lundberg
  • 42,009
  • 6
  • 90
  • 112