I want to disable windows 10 automatic update feature when a specific program is running. I checked this post however it is not what I wanted specifically. I also saw batch file scripts but they permanently disable updates which is also not suitable for me. Could you help me please?
1 Answers
I want to disable windows 10 automatic update feature when a specific program is running. I checked this post however it is not what I wanted specifically. I also saw batch file scripts but they permanently disable updates which is also not suitable for me. Could you help me please?
This can easily be performed.
function RunTask { $task = GetTask if ($task) { $firefox = Get-Process firefox -ErrorAction SilentlyContinue if ($firefox) { $task | Start-ScheduledTask Write-Output "$TaskPath$TaskName executed" } } else { Write-Output "$TaskPath$TaskName not found" } }
The above functions comes from a GitHub project called Win10ActiveHours, which runs a scheduled task, by running a scheduled task every 18 hours. The task resets the active hours at 0600 to 1800. While this does not prevent an update from being installed, it will prevent the automatic reboot, that normally would happen automatically.
I provided a 4 line modification, that will detect if a process is running, and if the task will be allowed to run. While it is possible to disable to disable Windows Update, through a PowerShell script, I do not actually suggest doing that. You could in theory run the provided function, when the Win10ActiveHours scheduled task is run, but you would have to write your own code to enable Windows Updates if process is not detected.
You can also set the Windows Update deferment policy by making a modification to the appropriate registry key through PowerShell.
Source:
- 44,080