gpt4 book ai didi

batch-file - 特定服务的 CPU 利用率百分比的 Windows 命令

转载 作者:行者123 更新时间:2023-12-04 06:41:38 26 4
gpt4 key购买 nike

关闭。这个问题是off-topic .它目前不接受答案。












想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。

8年前关闭。




Improve this question




有没有办法从 Windows 上的脚本获取特定服务的 CPU 利用率?我知道 wmic cpu get LoadPercentage将为整个系统提供 CPU 利用率,但是否可以为 winword.exe 等特定程序获取它?

最佳答案

Yes, it's possible .

此 wmic 命令打印所有进程的 CPU 使用率。然后你可以通过管道将它发送到 findstr过滤特定进程(使用标志 /c:<process name> )。

wmic path Win32_PerfFormattedData_PerfProc_Process get Name,PercentProcessorTime

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

关于batch-file - 特定服务的 CPU 利用率百分比的 Windows 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14215756/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com