wmic cpu get LoadPercentage始终返回空值 [英] wmic cpu get LoadPercentage always returns empty value
问题描述
我正在使用wmic命令获取当前的CPU使用率,该命令是:
I'm use wmic command to get current CPU utilization, the command are:
wmic cpu get LoadPercentage /value
起初它可以正常工作,但是不知何故它没有显示LoadPercentage,但总是返回空结果,如:
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=
这太奇怪了,我很确定结果与taskmgr.exe
不匹配.我也尝试了不带/value
的此命令,结果仍然相同.
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.
我已经在服务器中复制了一个大文件,而TaskManager和wmic中的CPU使用情况如下:
I have copy a large file in my server, and the CPU usage in TaskManager and wmic is like:
无论TaskManager中的值是多少,wmic始终返回空值.
no matter what value is in TaskManager, the wmic always return empty value.
推荐答案
我了解这是对死灵文章的回答.但是由于我在这里看不到任何正确的答案,解决方案是lodctr /R
.此命令将重新加载计数器.必须使用大写字母R,小写字母"r"返回错误.还要记住管理员权限.
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.
这篇关于wmic cpu get LoadPercentage始终返回空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!