Run scheduled task only when system is idle?

M

Marc S.

Is it possible to run a scheduled task only if the system has been idle
for some time (10-30 minutes) ?

I´d like to shutdown and restart the system automatically every day but
obviously this is no good idea while the system is still in use :(
 
P

Pegasus \(MVP\)

Marc S. said:
Is it possible to run a scheduled task only if the system has been idle
for some time (10-30 minutes) ?

I´d like to shutdown and restart the system automatically every day but
obviously this is no good idea while the system is still in use :(

Use the setting in the Task Scheduler's "Settings" menu to start the task
when the computer as been idle for at least x minutes.
 
M

Marc S.

Just a thought - is there any way to link my shutdown-script to the
screensaver? This way I could allow the user to adjust the idle-time.


Thanks in advance!
 
P

Pegasus \(MVP\)

Marc S. said:
Just a thought - is there any way to link my shutdown-script to the
screensaver? This way I could allow the user to adjust the idle-time.


Thanks in advance!

Put you shutdown command into a batch file and add a delay like so:
@echo off\
ping localhost -n 180 > nul
shutdown /.. /..

If you want to make the delay user-adjustable then you could write a little
VB Script that prompts him for a delay and modifies the batch file
accordingly.
 
P

Pegasus \(MVP\)

Marc S. said:
Just a thought - is there any way to link my shutdown-script to the
screensaver? This way I could allow the user to adjust the idle-time.


Thanks in advance!

At second thoughts: You don't need the "ping" command to generate a delay.
Shutdown.exe has its own delay switch. Your script should therefore do two
things:
1. Prompt the user for a delay.
2. Generate the batch file with shutdown.exe inside.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top