No announcement yet.

Run a task when computer is idle

  • Filter
  • Time
  • Show
Clear All
new posts

  • Run a task when computer is idle

    Hello guys,

    I need help to run a task when computer is idle. I've tried to run it through the Task Scheduler, but for some reason, it rarely, if ever runs. I think this has something to do with task scheduler wanting the cpu usage to be lower than 10% for it to run a task after x minutes of idle time. Which makes it hard for the scheduled task to kick in as expected.

    So I gave up on that, and tried to schedule it through the screen saver instead, as the screen saver is not as demanding as the Task scheduler when it comes to amount of cpu usage that needs to be idle.

    I downloaded a batch to exe converter, then converted the batch file to exe, renamed the .exe to .scr extension, and set the file as screensaver.

    Now the task runs more often than before, but its still not running as often as I'd like it to run (every five minutes). Sometimes it will run, others it will not. I think this has something to do with IE9. But even if I turn off all add-ons, it still sometimes does not run. Does anyone have any suggestions on how I can schedule a task to run when the computer has been idle for five minutes?

  • #2
    Re: Run a task when computer is idle

    What is the task running?

    Why not just schedule it to run every five minutes?


    • #3
      Re: Run a task when computer is idle

      Its a batch file that will close all open windows and start IE9 from scratch, so only IE9 is open with the Home page. The batch file itself works just fine. But I want it to only run when the computer has been idle for five minutes.

      I've already tried to schedule it through Task scheduler, but it will only run 1 to 2 times out of 10. If I schedule it through screensaver, it will run about 5 times out of ten. Which is good, but still not good enough.

      And thats how far I've gotten. Currently I am looking for a powershell script that will create a counter that counts down from 300 to 0, using 1 second on every digit, if the mouse is not moved, and no keys are pressed for five minutes, the counter will reach 0 and the task will run.

      But if the mouse is moved and/or a key is pressed, the counter will reset to 300, and will start counting down towards 0 again (loop indefinitely).

      Because thats the only way I can be sure that it will run 100% if there is no mouse/keyboard activity. Otherwise there seems to be too many variables, of which are hampering the task from running on five minutes idle time (which basically for us normal humans read, five minutes of no mouse/keyboard activity).