thank you for saying this! I have been struggling with windows 11 reboots have tried 5 different things that dont work at all.
How to disable Windows 11 automatic reboots?
Hi,
I have browsed this forum but found so far no real solution:
It has happened to my now several times that I was running tasks over extended periods of time only to come back to my PC the next morning to find Windows 11 had done an automatic reboot! So not only the tasks weren't finished, worse, lots of preparatory work was lost!
I don't want Windows to ever automatically reboot after an update. Never. Ever. Period. I want to be informed about updates, that's fine, and I keep Windows 11 up to date, but under no circumstances ever is it acceptable that Windows just shovels an update on my PC and disrupts overnight tasks and REBOOTS(!) my PC all by itself.
So it would be very helpful if somebody could tell me how to disable these automatic update reboots once and for all. I don't want to "pause" Updates (I absolutely want updates, I just want to control myself when the updates are done) and resetting "work hours" is of no use unless I can set it to 24 hours.
Best regards
Nick
Windows for home | Windows 11 | Windows update
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
84 answers
Sort by: Oldest
-
Anonymous
2024-07-09T17:30:47+00:00 -
Anonymous
2024-07-09T19:57:28+00:00 Hi Mauro,
This seems to stop the update, but, the command prompt window opens repeatedly (like every 10 minutes) to run this code and the window opens over the top of what ever I am doing at the time. I then have to wait 5 or so seconds for it to finish and self-close or I have to minimize it. Is there a way to stop this from happening?
Thank you for the help!
Josh
-
Anonymous
2024-07-10T09:21:57+00:00 I think you set the repeat time wrong. go to tasks and edit it in order to run every 1 hour.
Another issue happen to me. sometimes the batch windows does not close, waiting to a response in a prompt. A Yes or No prompt and I every time press Y. No all the time the window stops asking for the answer, but, still less annoying than the restart without asking issue.
-
Anonymous
2024-07-10T11:20:17+00:00 Running this as admin in powershell will create a ps1 script that cancels pending restarts (with logging), and schedule it as a task.
Microsoft, don't be Apple. This also is not an effective way to get me to PAY for pro, if that's your game.
Create the script to cancel pending restarts with logging
$scriptContent = @"
`$logPath = "C:\Scripts\CancelRestartLog.txt"
function Log-Message {
param([string]`$message) `$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" "`$timestamp - `$message" | Out-File -FilePath `$logPath -Append}
Log-Message "Script execution started"
$restartCancelled =$falseif (Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" -EA Ignore) {
shutdown /a `$restartCancelled = `$true}
if (Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -EA Ignore) {
shutdown /a `$restartCancelled = `$true}
if (Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" -EA Ignore) {
shutdown /a `$restartCancelled = `$true}
if (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -EA Ignore) {
shutdown /a `$restartCancelled = `$true}
if (Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Name PendingFileRenameOperations -EA Ignore) {
shutdown /a `$restartCancelled = `$true}
if (`$restartCancelled) {
Log-Message "Restart cancelled successfully"} else {
Log-Message "No pending restart detected"}
Log-Message "Script execution completed"
"@
Save the script to a file
$scriptPath = "C:\Scripts\CancelRestart.ps1"
New-Item -ItemType Directory -Force -Path (Split-Path $scriptPath)
Set-Content -Path $scriptPath -Value $scriptContent
Create a scheduled task
$taskAction = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-ExecutionPolicy Bypass -File
"$scriptPath""$taskTrigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 15)
$taskSettings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit (New-TimeSpan -Minutes 5)
$taskPrincipal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount -RunLevel Highest
Register-ScheduledTask -TaskName "CancelWindowsRestart" -Action $taskAction -Trigger $taskTrigger -Settings $taskSettings -Principal $taskPrincipal -Force
Write-Host "Script created and scheduled task set up successfully. Logs will be written to C:\Scripts\CancelRestartLog.txt"
-
Anonymous
2024-07-13T13:45:49+00:00 So I did this and it seemed to work for some time. I noticed a notice early this week that windows was pending a reboot but it went days without.......until this morning. I got up and my machine was rebooted from the update and work from overnight was lost. So damn frustrating. I really don't get this micromanaging mentalities.