Reputation: 205
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
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