Howto prevent auto reboot » Historie » Version 1
Jeremias Keihsler, 21.06.2025 12:05
| 1 | 1 | Jeremias Keihsler | h1. Howto prevent auto reboot |
|---|---|---|---|
| 2 | |||
| 3 | taken from: https://answers.microsoft.com/en-us/windows/forum/all/how-to-disable-windows-11-automatic-reboots/d7766f02-59a1-48f4-af6e-761345704ead |
||
| 4 | |||
| 5 | this sounds quite plausible, not yet tested (as of 2025-06-21) |
||
| 6 | |||
| 7 | Make a batch command file eg. disablereboot.bat, i.e. Open notepad and paste the code below: |
||
| 8 | |||
| 9 | <pre><code class="shell"> |
||
| 10 | for /f %%i in ('powershell "((get-date).Hour+18) %% 24"') do set startHour=%%i |
||
| 11 | for /f %%i in ('powershell "((get-date).Hour+12) %% 24"') do set endHour=%%i |
||
| 12 | |||
| 13 | reg add HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /v ActiveHoursStart /t REG_DWORD /d %startHour% /f |
||
| 14 | reg add HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /v ActiveHoursEnd /t REG_DWORD /d %endHour% /f |
||
| 15 | </code></pre> |
||
| 16 | |||
| 17 | Save the file anywhere on your computer like @C:\MyStuff\disablereboot.bat@ |
||
| 18 | |||
| 19 | Then use Task Scheduler: |
||
| 20 | |||
| 21 | Press the windows key + R at the same time and in the prompt type: |
||
| 22 | |||
| 23 | @taskschd.msc@ |
||
| 24 | |||
| 25 | and configure to run the code Daily and repeat every hour for 1 day, i.e.: |
||
| 26 | |||
| 27 | in the *right panel* click *Create task* |
||
| 28 | |||
| 29 | name it whatever way you want in the *General* tab |
||
| 30 | |||
| 31 | In the *Triggers* tab create a new one with the contents below: |
||
| 32 | |||
| 33 | Daily, repeat task every 1 hour for duration at: 1 day |
||
| 34 | |||
| 35 | in *Actions* click in new with the action Start a program and in the browse locate your previous saved bat file, in this example, C:\MyStuff\disablereboot.bat. |
||
| 36 | |||
| 37 | This will keep changing your working hours so that it is never not a working hour. This way you will never get an auto reboot and you can choose yourself when to reboot. |