ca143508 Posted November 27, 2008 Posted November 27, 2008 Hey guys, Is there a way to determine the current CPU usage when a script is run? Cheers Mike
monoceres Posted November 27, 2008 Posted November 27, 2008 I guess someone has done it before:http://www.autoitscript.com/forum/index.ph...highlite=%2BCPU Broken link? PM me and I'll send you the file!
November Posted November 27, 2008 Posted November 27, 2008 Hi there m8,look at this POST or $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" while 1 $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Output &= "LoadPercentage: " & $objItem.LoadPercentage & @CRLF Next ConsoleWrite($Output) Else Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_Processor" ) Endif $Output = "" wend Func WMIDateStringToDate($dtmDate) Return (StringMid($dtmDate, 5, 2) & "/" & _ StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _ & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2)) EndFuncCheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now