Welcome to the Power Users community on Codidact!
Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.
Post History
Windows 10 allows you to set "office hours" during which it won't automatically reboot. Unfortunately, it doesn't allow you to set the entire day as office hours. So the trick is to change your off...
Answer
#1: Initial revision
Windows 10 allows you to set "office hours" during which it won't automatically reboot. Unfortunately, it doesn't allow you to set the entire day as office hours. So the trick is to change your office hours frequently in such a way that it's always office hours. https://github.com/Maimer/update-active-hours contains a simple implementation of this trick; I have an uncommitted fork which offsets 1 hour back in the past - I can't remember, but I may have found that this was necessary. `update_active_hours.ps1`: $registryPath = "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" if (Test-Path -Path "${registryPath}") { $currentHour = (Get-Date).hour $activeHoursStart = $currentHour - 1 if ($activeHoursStart -lt 0) { $activeHoursStart = $activeHoursStart + 24 } $activeHoursEnd = $activeHoursStart + 12 if ($activeHoursEnd -gt 23) { $activeHoursEnd = $activeHoursEnd - 24 } Set-ItemProperty -Path "${registryPath}" -Name "ActiveHoursStart" -Value "${activeHoursStart}" Set-ItemProperty -Path "${registryPath}" -Name "ActiveHoursEnd" -Value "${activeHoursEnd}" } This is run by a scheduled task which executes every 6 hours with action Powershell.exe -ExecutionPolicy Unrestricted -File path\to\update_active_hours.ps1