Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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