Skip to content

Instantly share code, notes, and snippets.

@saper-2
Last active March 21, 2024 20:22
Show Gist options
  • Save saper-2/8d6971e91a226acb8b418ccd2e62f7ee to your computer and use it in GitHub Desktop.
Save saper-2/8d6971e91a226acb8b418ccd2e62f7ee to your computer and use it in GitHub Desktop.
Windows 10 Windows Update forced reboot prevention using Task Scheduler

Tasks for Task Scheduler

2 tasks for Task Scheduler (taskschd.msc) to disable forced reboot in windows 10 (Home) version.

You can either save those 2 files as xml, and then immport to taskschd.msc and enable them. Or create those 2 task yourself - instructions below.

Create your own tasks in Task Scheduler

Task 1 - Kill notification processes

There is 2 processes that will nag you to reboot and they might initiate reboot too.

Open taskschd.msc using [Win]+X and choose Run, in Run dialog type taskschd.msc

  1. Create new task clicking Create Task in Actions panel on the right side of window.
  2. In new dialog, type name, e.g.: SlayWSU 😁 , in security options:
    • select Run whether user is logged on or not
    • check Do not store password. The task [...] local computer resources
    • check Run with highest privileges
  3. Go to tab Triggers , click New , in window New Triggeer:
  • select in Begin the task = On a schedule
  • section Settings: select: Daily , and Start leave current date & time , set Recur every to 1 days,
  • Section Advanced settings:
    • check Repeat task every , choose from list 5 mintes,
    • select for duration of = Indefinitely,
    • leave only Enabled checked.
  • click OK
  1. Go to tab Actions and create 2 actions, click New and in New action window:
  • select Action: Start a program , in section Settings enter:
    • Program/script = C:\Windows\System32\taskkill.exe
    • Add arguments = /IM MusNotifyIcon.exe /t /f
  • select Action: Start a program , in section Settings enter:
    • Program/script = C:\Windows\System32\taskkill.exe
    • Add arguments = /IM MusNotification.exe /t /f
  1. Go to tab Conditions and uncheck evrything,
  2. Go to tab Settings and check & set:
  • check Allow task to run on demand
  • check Run the task as soon as possible ...
  • check If the task fails, restart every ans set to 1 minute , and set attmept o restart up to set to 3 (but can be higher)
  • check Stop the task in runs longer than and select 3 days
  • check If the task does not end when requested, force it to stop
  • At bottom If the task is alredy running, then the following rule applies select Do not start a new instance
  1. Click OK to create task.

Task 2 - Disable reboot helpers Tasks

In task scheduler ther is few task that have to "assist" to force reboot, you can delete them but thwey will be recreated... Bet method is to disable them using another task (that run every few min) 😁

In open Task Scheduler (taskschd.msc):

  1. Create new task clicking Create Task in Actions panel on the right side of window.
  2. In new dialog, type name, e.g.: wu_reboot_disable 😁 , in security options:
    • In When running the task, use the following user account , click button Change User or group, type in new window in field Enter the object name to select: SYSTEM and click OK,
    • check Run with highest privileges
  3. Go to tab Triggers , click New , in window New Triggeer:
  • select in Begin the task = On a schedule
  • section Settings: select: Daily , and Start leave current date & time , set Recur every to 1 days,
  • Section Advanced settings:
    • check Repeat task every , choose from list 5 mintes,
    • select for duration of = Indefinitely,
    • leave only Enabled checked.
  • click OK
  1. Go to tab Actions and create 5 actions, click New and in New action window:
  • select Action: Start a program , in section Settings enter:
    • Program/script = schtasks
    • Add arguments = /change /tn \Microsoft\Windows\UpdateOrchestrator\Reboot /DISABLE
  • select Action: Start a program , in section Settings enter:
    • Program/script = schtasks
    • Add arguments = /change /tn \Microsoft\Windows\UpdateOrchestrator\MusUx_LogonUpdateResults /DISABLE
  • select Action: Start a program , in section Settings enter:
    • Program/script = schtasks
    • Add arguments = /change /tn \Microsoft\Windows\UpdateOrchestrator\Reboot_AC /DISABLE
  • select Action: Start a program , in section Settings enter:
    • Program/script = schtasks
    • Add arguments = /change /tn \Microsoft\Windows\UpdateOrchestrator\Reboot_Battery /DISABLE
  • select Action: Start a program , in section Settings enter:
    • Program/script = schtasks
    • Add arguments = /change /tn \Microsoft\Windows\UpdateOrchestrator\USO_UxBroker /DISABLE
  1. Go to tab Conditions and uncheck evrything,
  2. Go to tab Settings and check & set (everything else leave unchecked):
  • check Allow task to run on demand
  • check Run the task as soon as possible after [...]
  • check If the task fails, restart every ans set to 1 minute , and set attmept o restart up to set to 10 (but can be higher)
  • check Stop the task in runs longer than and select 1 hour
  • At bottom If the task is alredy running, then the following rule applies select Do not start a new instance
  1. Click OK to create task.

Now you have to remember to reboot PC every a while otherwise you might have annoying problems with WU not updating, or can't install updates...

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2019-11-02T17:58:26.8609414</Date>
<Author>ThePC\User</Author>
<Description>Get rid of annoying WSU</Description>
<URI>\Slay WSU</URI>
</RegistrationInfo>
<Triggers>
<TimeTrigger>
<Repetition>
<Interval>PT5M</Interval>
<StopAtDurationEnd>false</StopAtDurationEnd>
</Repetition>
<StartBoundary>2019-11-04T16:27:00</StartBoundary>
<ExecutionTimeLimit>PT30M</ExecutionTimeLimit>
<Enabled>true</Enabled>
</TimeTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-21-3978050048-519793749-76888197-1001</UserId>
<LogonType>S4U</LogonType>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
<Priority>7</Priority>
<RestartOnFailure>
<Interval>PT1M</Interval>
<Count>3</Count>
</RestartOnFailure>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\Windows\System32\taskkill.exe</Command>
<Arguments>/IM MusNotifyIcon.exe /t /f</Arguments>
</Exec>
<Exec>
<Command>C:\Windows\System32\taskkill.exe</Command>
<Arguments>/IM MusNotification.exe /t /f</Arguments>
</Exec>
</Actions>
</Task>
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2019-11-02T22:51:57.5731895</Date>
<Author>SAPER-PC\saper</Author>
<URI>\wu_reboot_disable</URI>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<Repetition>
<Interval>PT5M</Interval>
<StopAtDurationEnd>false</StopAtDurationEnd>
</Repetition>
<StartBoundary>2019-11-02T22:00:00</StartBoundary>
<Enabled>true</Enabled>
<ScheduleByDay>
<DaysInterval>1</DaysInterval>
</ScheduleByDay>
</CalendarTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-18</UserId>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>false</AllowHardTerminate>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<Priority>7</Priority>
<RestartOnFailure>
<Interval>PT5M</Interval>
<Count>10</Count>
</RestartOnFailure>
</Settings>
<Actions Context="Author">
<Exec>
<Command>schtasks</Command>
<Arguments>/change /tn \Microsoft\Windows\UpdateOrchestrator\Reboot /DISABLE</Arguments>
</Exec>
<Exec>
<Command>schtasks</Command>
<Arguments>/change /tn \Microsoft\Windows\UpdateOrchestrator\MusUx_LogonUpdateResults /DISABLE</Arguments>
</Exec>
<Exec>
<Command>schtasks</Command>
<Arguments>/change /tn \Microsoft\Windows\UpdateOrchestrator\Reboot_AC /DISABLE</Arguments>
</Exec>
<Exec>
<Command>schtasks</Command>
<Arguments>/change /tn \Microsoft\Windows\UpdateOrchestrator\Reboot_Battery /DISABLE</Arguments>
</Exec>
<Exec>
<Command>schtasks</Command>
<Arguments>/change /tn \Microsoft\Windows\UpdateOrchestrator\USO_UxBroker /DISABLE</Arguments>
</Exec>
</Actions>
</Task>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment