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
Balthier

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
brianzion

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

My System SpecsSystem Spec
22 Jun 2011   #3
Oaken

Windows 7
 
 

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

24 Jun 2011   #4
Balthier

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
Dwarf

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
Balthier

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
bshop88

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
AlexHall

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
Thread Forum
Windows 7 schedule Task
Hi, Currently having some problem on the schedule job task on windows 7. example script in my bat file as list below. so we schedule and it run only thing is it did not show the dos windows for us to reply message. kindly help. Thanks echo on said Hello pause.
General Discussion
Schedule task to run when a new profile is created using Win 7
I need to replace a RunOnce procedure from XP. Using it with Win 7 is interrupted with UAC prompts which is an unacceptable option and disabling UAC within our environment is not an option. I am attempted to replace the process with Task Scheduler. However, I only want this to run when a new...
General Discussion
how to set a schedule task to run chkdsk
I tried to to set a schedule task to run chkdsk with a batch file, such as follwoing: echo y|chkdsk C: /F /R shutdown -r I run it on cmd.exe it needs administrator privilege. I run cmd.exe as administrator, then it works. I tried to run it on schedule task and set run by a administrator type...
General Discussion
Schedule a task
I want the computer to execute the following line: mms://wamu-wm.streamguys.com/WAMU-1 at 7:00 am until 10 am Monday through Friday. Unconditionally. I have explored the task menus ad-nausium... and still it does not trigger. There are simply too many options to list them here to...
Customization
How do I schedule a Windows task to run in the foreground?
How do I force a scheduled task to run as a foreground window, to capture the focus when it runs? I wrote a little Delphi app to open a reminder window, but when I schedule it the silly window stays in the background, behind the other 50 windows I routinely have open, and I'm likely to miss it....
Software
Can I schedule a XP Mode task from Win 7?
I have a very old legacy app that would not run or install in Win 7 compatibility mode. I download the Windows VM patch, and the XP Mode application, installed them, and was able to get the application to run. Following some information I found here, I was able to get it pinned to the start menu...
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 15:33.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App