VBScript通过WMI获取CPU使用率的代码

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

On Error Resume Next
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor",,48)

For Each objItem in colItems
WScript.Echo "LoadPercentage: " & objItem.LoadPercentage
Next