wmic cpu get LoadPercentage always returns empty value

拟墨画扇 提交于 2020-06-27 08:50:10

问题


I'm use wmic command to get current CPU utilization, the command are:

wmic cpu get LoadPercentage /value

It's works fine at first, but somehow it doesn't shows the LoadPercentage, but always returns with empty result like:

C:\Users\Administrator>wmic cpu get LoadPercentage /value


LoadPercentage=

It's so weird and I'm pretty sure that the result don't match with the taskmgr.exe. I also tried this command without /value, the result is still the same.

I have copy a large file in my server, and the CPU usage in TaskManager and wmic is like:

enter image description here

no matter what value is in TaskManager, the wmic always return empty value.


回答1:


I understand that this is an answer for a necro post. But as I can't see any correct answer here, the solution is lodctr /R . This command will reload counters. Must use a capital R, lower case 'r' returns an error. Remember Admin Privs as well.




回答2:


Use below mentioned powershell query for the same:

gwmi Win32_PerfFormattedData_PerfOS_Processor | select PercentProcessorTime


来源:https://stackoverflow.com/questions/24503084/wmic-cpu-get-loadpercentage-always-returns-empty-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!