Disable UpdateOrchestrator Reboot task

I was eventually able to disable the Reboot task. Firstly, I tried the following line in cmd:

SCHTASKS /Change /TN "Microsoft\Windows\UpdateOrchestrator\Reboot" /DISABLE

It did not work, and the error message said I do not have sufficient privileges to modify the task (even though I work on a Windows admin account). However, thanks to this message, I was able to find information about NSudo program. Per the already linked hint, I used it in a TrustedInstaller mode to start cmd and - lo and behold - SCHTASKS now worked perfectly, allowing me to disable the Reboot task. Windows is user friendly, they said.

EDIT: To make things clearer, NSudo gives you privilages over Reboot task and you do not have to use exactly the cmd listed above to disable Reboot task. Alternatively you may, for example, use it to run taskschd.msc and edit the Reboot task to your liking in the window that opens (for example by unchecking the "Wake up..." checkbox).

I have found that the changes don't always stick. The aforementioned message states that on has to issue the following command using cmd from NSudo (note you may have to translate the account names to language your Windows uses):

icacls "%WINDIR%\System32\Tasks\Microsoft\Windows\UpdateOrchestrator\Reboot" /inheritance:r /deny "Everyone:F" /deny "SYSTEM:F" /deny "Local Service:F" /deny "Administrators:F"

S-1-5-18 is a local SYSTEM account. It has no password and only services can run under it.

But there is a tool psexec that can allow a user app to run under SYSTEM account. You can use it like this:

psexec.exe -i -s schtasks ...

However, even disabling wakeup for the Reboot task won't stop the reboots entirely.

The following alternative solution worked for me:

Go into "Power Options" -> "Change When Computer Goes to Sleep" -> "Advanced Options".

Under "Sleep" you'll see "Allow wake timers". Set both "on battery" and "plugged in" of to "Disable".

power options - sleep

That should take care if it.

You'll have to check again after updates as Microsoft sometimes resets that and enables the wake up timers when plugged in.