Can't get task schedular to run a batch on idle.
Hello,This may sound odd but I have a client who wants automatic reboot when his computer is idle for 10 minutes. I got this working in XP no problem (he has 2 PCs). I tried to do the same thing with a task in Windows 7 and couldn't get it to work. If I run the batch file manually or even force it to run from task schedular in Windows 7 it runs fine. There are two places for triggers in Windows 7 to set on idle. I've tried them both. I'm not sure if I set the on idle settings wrong or if I need to do something to make the computer think it is idle in Windows 7. I set it for 1 minute for testing and left the computer alone for 2 minutes and it still didn't trigger. If I do the same with XP it reboots. I'm sure it is an easy thing to do but I can't figure out what I'm doing wrong so if someone could help out someone with a newbie question I would appreciate your assistance.Thanks
November 21st, 2009 4:05pm

You might have to make sure that it is running with the highest priviliges, see the General tab on the scheduled task and see if "Run with highest priviliges" is checked.
Free Windows Admin Tool Kit Click here and download it now
November 21st, 2009 5:03pm

Thanks - I should have mentioned that I did try that and it doesn't work. The user that is logged in is an administrator on the workstation and it is not a member of a domain.
November 21st, 2009 5:54pm

Ok, so what are the settings on the "condition" page? Do you have the first option to 10 minutes and the other one to "Do not wait"?I found the following information which could be useful, found in the help files: Idle Conditions You can set a condition that tells the task to run only if the computer is in an idle state for a specific amount of time when a trigger is activated. When you set this condition, you also set the amount of time to wait (after the task is triggered) for the computer to enter an idle state. The Task Scheduler service will check if the computer is in an idle state every 15 minutes. A computer is considered to be in an idle state when a screen saver is running. If a screen saver is not running, then the computer is considered to be in an idle state if there is 0% CPU usage and 0% disk input or output for 90% of the past fifteen minutes and if there is no keyboard or mouse input during this period of time. Once the Task Scheduler service detects that the computer is in an idle state, the service only waits for user input to mark the end of the idle state. If a task is set to start only if the computer is idle for 30 minutes, and the task waits for the computer to be idle for 10 minutes, then the task will launch in 5 minutes only if the computer has been idle for 25 minutes prior to the time the trigger was activated.The task will not start if the computer enters an idle state 5 minutes after the trigger is activated. If the Stop if the computer ceases to be idle condition is selected for a task and the task is running while the computer is in an idle state, then the task will stop running when the computer ceases to be idle. The task that is stopped by this condition will start running again the next time the computer enters an idle state if the Restart if idle state resumes condition is selected.
Free Windows Admin Tool Kit Click here and download it now
November 21st, 2009 6:18pm

Thanks for your help. I'll let you know what settings I have in case it makes it easier for you to figure out what I messed up.batch file - logoffuser.bat - shutdown /f /r /t 60 - which runs fine when you run it manuallyby clicking on it or from task schedular when you force it to runTask schedularcreate taskset to run only when that user is logged on - they have other users who use that computer but don't want it to run for everyone. The user logged on is an adminstator on that PC.set to highestI tried setting the trigger on idle (also tried it without that trigger)The action is the batch fileThe conditions I set are set to run on idle for 1 minuteDo not waitstop if PC ceases to be idle.It is on a PC so it always has power
November 21st, 2009 7:51pm

Did you get this to work OK?
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2009 10:26pm

Thanks for checking. I think it is working but taking longer to go to idle than the time I specify in task manager. I'll be able to check next week when I go back to that client.
November 24th, 2009 12:37am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics