用于特定服务的CPU利用率%的Windows命令

use*_*762 8 batch-file batch-processing

嗨有没有办法让特定服务运行窗口的CPU利用率.我希望wmic cpu得到LoadPercentage会为整个系统提供cpu util但是有可能获得像winword.exe这样的特定服务

ind*_*div 11

是的,这是可能的.

此wmic命令打印所有进程的CPU使用情况.然后你可以管道它来findstr过滤特定的进程(使用标志/c:<process name>).

wmic path Win32_PerfFormattedData_PerfProc_Process get Name,PercentProcessorTime
Run Code Online (Sandbox Code Playgroud)

不要help findstrhelp find命令行看到更多的方法可以过滤列表.

例如:

C:\> wmic path Win32_PerfFormattedData_PerfProc_Process get Name,PercentProcessorTime | findstr /i /c:chrome
chrome                  24
chrome#1                0
chrome#2                0
chrome#3                0
Run Code Online (Sandbox Code Playgroud)