Sunday, August 20, 2017

Command-line Resource Monitor for Windows?


On Windows, there's a GUI "Task Manager", and there's also a great little command-line "tasklist.exe" which lets me see most of the same data but in text that's really easy to parse from a script.


Is there an analogous command-line tool for "Resource Monitor"? I'm looking for something that will list global CPU/disk/network/memory usage, and/or per-process usage.


Answer



I think you are looking for typeperf. It should work for:



  • Windows Server 2003 - 2016

  • Windows 10

  • Windows 7

  • Windows Vista

  • Windows XP


An example:


typeperf "\Processor(_Total)\% Processor Time"

will log the processor time until you hit Ctrl-C. Adding -sc 5 will report 5
instances:


typeperf -sc 5 "\Processor(_Total)\% Processor Time"

Here is example for disk activity, total bytes per second:


typeperf -si 2 "\LogicalDisk(_Total)\Disk Bytes/sec"

Windows Performance Monitor Disk Counters Explained


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...