Get Process CPU Usage Using WMI

This article was posted more than 1 year ago. Please keep in mind that the information on this page may be outdated, insecure, or just plain wrong today.

I recently blogged about another method to obtain a process’ CPU usage via Command Line: Get CPU Usage of a Process from Command Line

Here’s a quick command line method for grabbing CPU usage of a process by process id, process name, or caption.

By Process ID

wmic path win32_perfformatteddata_perfproc_process where (IDProcess = '3488') get Name, Caption, PercentProcessorTime, IDProcess /format:list
byprocid

By Process Name

wmic path win32_perfformatteddata_perfproc_process where (Name='iexplore') get Name, Caption, PercentProcessorTime, IDProcess /format:list
byprocname

By Process Name (fuzzy)

wmic path win32_perfformatteddata_perfproc_process where (Name like '%iexp%') get Name, Caption, PercentProcessorTime, IDProcess /format:list
byprocnamefuzzy

Any processes with CPU time over 50%

wmic path win32_perfformatteddata_perfproc_process where (PercentProcessorTime ^> 50) get Name, Caption, PercentProcessorTime, IDProcess /format:list
bycputime