HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
“Create” -> “DWORD value (32-bit)” ->NoAutoRebootWithLoggedOnUsers
Set to 1
Stop Windows 10, 11 from Restarting: The Best Methods! | DiskInternals
Stop windows from restarting
regedit