Hello
Thank you for posting in Microsoft Community forum.
It sounds like you've put a lot of thought into this! Here are a few alternative strategies that might help you achieve your goal without causing too much confusion for your patrons:
Use a Scheduled Task with Conditions:
You can create a scheduled task that only triggers the restart if the computer has been idle for a certain period and the user is logged in. This way, the task won't run immediately upon login. In Task Scheduler, you can set conditions under the "Conditions" tab to ensure the task only runs if the computer is idle for a specified time.
Implement a Custom Idle Detection Script:
Instead of relying on GetLastInputInfo, you could use a more robust script that checks for user activity. For example, you can use a combination of PowerShell and Task Scheduler to monitor user activity and trigger a restart only if the computer has been idle for the desired period. Here’s a basic example:
$idleTime = 15 * 60 # 15 minutes in seconds
$lastInput = [System.Environment]::TickCount
while ($true) {
*$currentInput = [System.Environment]::TickCount*
*if (($currentInput - $lastInput) -gt $idleTime \* 1000) {*
*shutdown.exe /r /f /t 0*
*}*
*Start-Sleep -Seconds 60*
}
This script checks for idle time and restarts the computer if it exceeds 15 minutes.
Use Group Policy to Enforce Idle Timeout:
If your library computers are part of a domain, you can use Group Policy to enforce an idle timeout. This can be configured to log off the user or restart the computer after a specified period of inactivity.
Third-Party Software:
There are third-party tools designed to manage public computers, which often include features for handling idle time and automatic restarts. These tools can provide more flexibility and ease of use compared to built-in Windows tools.
Educate Users:
If you decide to go with the Ctrl+Alt+Del method, consider creating clear, simple instructions and placing them prominently near the computers. This can help users understand the new process and reduce confusion.
Each of these methods has its pros and cons, so you might need to experiment a bit to find the best fit for your library's needs.
Best Regards,
Wesley Li