Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Schedule a task for when computer is idle


22 Jun 2011   #1

Windows 7 Ultimate x64
 
 
Schedule a task for when computer is idle

Hello guys,

I'm having difficulties scheduling a task for when computer is idle. What I want to do is run a task after the computer has been idle for five minutes. I've tried creating a scheduled task in different ways, which will do this, but to no avail.

I go to Task scheduler to create a task:

General Tab
Give the task a name, put the check box to run with the highest priv., and configure it for Win 7.

Triggers Tab
New, Begin the task on idle, Repeat task for 15 minutes indefinitely, Enabled.

Action Tab
Start whatever program.

Conditions Tab
Start the task only if computer is idle for 5 minutes. Do not wait for idle.

The settings I have not described stay default.

Now from what I can gather from this is that every 15 minutes, the computer will run the task if the computer stays idle for 5 minutes. Say, I start the computer and leave it like that, then the task should run after 5 minutes. Then after 10 minutes, it will once again start checking to run the task.

But this just does not work. If I leave the computer idle for even 7 minutes after startup, nothing happens. What am I doing wrong?


My System SpecsSystem Spec
.

22 Jun 2011   #2

Operating System : Windows 7 Home Premium Edition 6.01.7600 SP1 (x64)
 
 

My System SpecsSystem Spec
22 Jun 2011   #3

Windows 7 Professional 64bit SP1
 
 

This might help- MSDN: Task Idle Conditions
My System SpecsSystem Spec
.


24 Jun 2011   #4

Windows 7 Ultimate x64
 
 

Thanks for the suggestions guys, but I got mighty tired of the task scheduler, and went for a quick fix.

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 screen saver is absolutely awesome in every way possible, because it runs the task just as I want it to.

Conclusion, Screen Saver is king, Task Scheduler is overrated (when it comes to running tasks after x minutes of idle time). But it works great for sending the computer to sleep at a specified time, and then waking it up again after a few hours.
My System SpecsSystem Spec
24 Jun 2011   #5

Windows 8.1 Pro RTM x64
 
 

It is extremely difficult to get even the simplest of tasks (such as one to display a single word message) to work if the trigger condition is based on idle time. The reason for this is that the computer is very rarely (if at all) idle long enough in one go to satisfy the trigger condition. For example, you might have the task set to trigger when the system has been idle for 5 minutes. Let's suppose that the system is 100% idle for 4 mins 59 secs. At that point, there is brief system activity lasting just a few hundredths of a second. That is enough to cause the trigger condition not to be met, and so the task fails to run.
My System SpecsSystem Spec
24 Jun 2011   #6

Windows 7 Ultimate x64
 
 

Yup, thats what I found too. At least with the screen saver, it usually does kick in. And if you want to have a regular screen saver, you can just have the batch call it up at the end (or at the start I presume) from c:\windows\system32\nameofscreensaver.scr.

Btw, here is the batch file I've created (window will be minimized)

Code:
if not "%minimized%"=="" goto :minimized
set minimized=true
start /min cmd /C "%~dpnx0"
goto :EOF
:minimized
TASKKILL /F /IM nameoftask.exe /FI "STATUS eq RUNNING"
TASKKILL /F /IM nameoftask.exe /FI "STATUS eq RUNNING"
TASKKILL /F /IM nameoftask.exe /FI "STATUS eq RUNNING"
start iexplore
If you want to completely hide the cmd window from showing, you can have this vbs call up the batch file

Code:
Const HIDDEN_WINDOW = 12
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objStartup = objWMIService.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = HIDDEN_WINDOW
Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
errReturn = objProcess.Create("nameofbatchfile.bat", null, objConfig, intProcessID)
Just remember to either put the batch file in c:\windows\system32, or edit the vbs to include the path where you want to call the batch file from. Obviously you can use this vbs to hide any process/application.
My System SpecsSystem Spec
03 Apr 2012   #7

windows 7 64 bit
 
 

Hi, wonder if you might help me. i used your quick fix succesfully. except i cant get it to run invisibly. i keep
getting the prompt splash. any help would be greatly appreciated. please as detailed as possible. im not as
experienced as you
My System SpecsSystem Spec
05 Jun 2013   #8

Windows 7
 
 

A year later . . .

START /C <command>

(or something involving a /C switch?)

==OR==

Use nircmdc (free tool) along with a set window title, like this;

From a batch, name the window that you want to hide:

TITLE hidethis

Then:

nircmdc win hide ititle hidethis

The latter may momentarily flash the window.

My System SpecsSystem Spec
Reply

 Schedule a task for when computer is idle




Thread Tools



Similar help and support threads for2: Schedule a task for when computer is idle
Thread Forum
Schedule task to run when a new profile is created using Win 7 General Discussion
how do schedule a task when another program exists Software
how to set a schedule task to run chkdsk General Discussion
Schedule a task Customization
How do I schedule a Windows task to run in the foreground? Software
Can I schedule a XP Mode task from Win 7? Virtualization

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 05:18 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33