I'm attempting to kick off a piece of code I wrote when the CPU Usage reaches a specifiable percentage.

Can anyone direct me on how to accomplish this? Thus far I've tried using the task scheduler but to no avail.

I am using Windows Server 2008 R2.

link|improve this question
feedback

1 Answer

The best way to do this is to use the Windows Performance monitor Or WMI(I forgot what it stands for).

Using Perfmon, you can have it create a custom event when CPU usage gets to 80%, then make task scheduler run your program when it sees your custom event.

This is possible with WMI, but I've never used it. It's possibly a hair more efficient.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.