Hi.i have several programs running on my PC, and i want to make a script that reads the CPU and if it stays 100% for 30 or more seconds, to stop some programs.I searched the forum but i didn't find a script that can show the CPU usage.
Is there a way to get the CPU percentage?
Monitor cpu
Moderators: JRL, Dorian (MJT support)
Re: Monitor cpu
i Think this is easiest
Code: Select all
label>start
IfWindowOpen>Windows Task Manager
GetWindowText>Windows Task Manager,strText
Let>tmp0=(?m-s)^.*CPU.*%
RegEx>tmp0,strText,0,m,nm,0
If>nm>0
msg>m_1
endif
else
ExecuteFile>C:\Windows\System32\taskmgr.exe
wait>1
endif
wait>0.05
goto>start