Hi,
This can be achieved by using the 'Task Scheduler'. Follow the instructions below.
1) Click the start orb, type 'Task Scheduler' into the search box and press enter/return. The 'Task Scheduler' dialogue will appear.
2) In the left hand column, click 'Task Scheduler Library' and then in the right hand column 'Actions' click 'Create Task...'. The 'Create Task' dialogue will open.
3) Click the 'General' tab. Give the task a meaningful name and description e.g. 'AutoRestart' for the name and 'Automatically restart
after period of inactivity.' for the description. Also click the checkbox marked 'Hidden'.
4) Click the 'Triggers' tab and click 'New...'. On the dialogue that appears, click on the drop-down box next to 'Begin the task:' and select
'On idle'. In the 'Advanced settings' panel, ensure that the checkbox marked 'Enabled' has a tick in it. Click 'OK'.
5) Click the 'Actions' tab and click 'New...'. The default setting for this dialogue, 'Start a program', is what is required, so in the 'Settings' panel do the following. In the box under 'Program/script:' enter 'C:\Windows\System32\shutdown.exe'. In the 'Add arguments (optional):' box enter '/r /t 60 /c "The computer will restart in 1 minute. Please save any work. This action cannot be aborted."'. Click 'OK'.
6) The settings under the 'Conditions' and 'Settings' tabs are fine with their defaults, so click on 'OK'.
7) Note that because you clicked 'Hidden' above, this task will not appear in the scheduler. To show this task, in the right hand column 'Actions' click 'View' and check 'Show Hidden Tasks'. Remember to uncheck this if you want to hide the task again.
8) Close the 'Task Scheduler'. The task will begin running. After a period of inactivity of approximately 15 minutes, the computer will execute the task.
9) This is taken from the 'Help' dialogue.
"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."
For those interested, here is the code.
Code:
<?xml version="1.0" encoding="UTF-16" ?>
- <Task version="1.2" xmlns="[URL]http://schemas.microsoft.com/windows/2004/02/mit/task[/URL]">
- <RegistrationInfo>
<Date>2008-07-11T19:38:41.5828227</Date>
<Author>Cyclops-PC\Dwarf</Author>
<Description>Automatically restarts after period of inactivity</Description>
</RegistrationInfo>
- <Triggers>
- <IdleTrigger>
<Enabled>true</Enabled>
</IdleTrigger>
</Triggers>
- <Principals>
- <Principal id="Author">
<UserId>Cyclops-PC\Dwarf</UserId>
<LogonType>InteractiveToken</LogonType>
<RunLevel>LeastPrivilege</RunLevel>
</Principal>
</Principals>
- <Settings>
- <IdleSettings>
<Duration>PT10M</Duration>
<WaitTimeout>PT1H</WaitTimeout>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>true</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>P3D</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
- <Actions Context="Author">
- <Exec>
<Command>C:\Windows\System32\shutdown.exe</Command>
<Arguments>/r /t 60 /c "The computer will restart in 1 minute. Please save any work. This action cannot be aborted.</Arguments>
</Exec>
</Actions>
</Task>
Hope that this helps.
Dwarf