Try the Dan Oross solution.
_______________
- Open Notepadand enter these four lines of text...
for /f "tokens=*" %%a in ('powershell "(Get-Date).Hour"') do set startHour=%%a
set /a "endHour=(%starthour%+18)%%24"
reg add HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /v ActiveHoursStart /t REG_DWORD /d %startHour% /f
reg add HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /v ActiveHoursEnd /t REG_DWORD /d %endHour% /f
- Save the file as "Roll_Active_Hours.cmd". Don't use .BAT. It's ancient DOS. .CMD is slightly more modern, the NT era.
- Open Task Scheduler and create a new task. Select "Run with highest privileges" and "Run whether user is logged in or not" and "Configure For: Windows 10", since there is no Windows 11 option within Windows 11.
- In Triggers, create a single trigger. Choose "One time" and choose today's date and 12:00:00 PM. Then select Repeat task every: 12 hours. If there is no option in the drop down for 12 hours... just type it in. I check "Stop task if runs longer than: " and select 1 minute. If it takes longer than that, something is wrong. And of course, check the Enabled box to activate the trigger.
- In the Actionstab, select "Start a program" and then use the Browse... button to locate the "Roll_Active_Hours.cmd" script from steps 1 and 2.
- Everything on the Conditionstab should be unselected. In the Settingstab, check "Allow task to be run on demand" and "Run task as soon as possible after a scheduled start is missed" and "If the running ask does not end when requests, force it to stop".
That's it. No windows flashing when the task runs. Only runs twice per day. You can run it manually if you like. And Windows 11 will never restart on its own.
___________
This still the best solution for this problem.
However, it's recommend check if there's a update needing to restart.
I spend days without checking and the update does not force restart.