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?
-
1I doubts there is a way to do what you want, but maybe someone here can figure a way.– MoabNov 18, 2019 at 13:36
-
I concur with the previous comment.– user931000Nov 18, 2019 at 13:41
-
Do you have source to the application? The script that continuously updates the active hours, which disables Windows Updates, on any version of Windows can easily be added the source code of any application.– RamhoundNov 18, 2019 at 15:18
-
Perhaps a powershell script setup in task-scheduler to run every 1-5 minutes - when run, it detects the .exe you want to exempt, and if so makes sure update is disabled. If it doesn't detect it, it enabled updates again. Perhaps you could even set the trigger as the startup of the .exe ?– SmockNov 18, 2019 at 16:05
2 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:
-
I checked the git link and I am trying to understand since I can not read script code, in your script, you assume your open program is firefox right? So as long as it is open , you say, go on continue to update but don't reboot. Right?– DenizNov 19, 2019 at 11:13
Most Retail and OEM Windows 10 will update at some point whether you wish it to or not. You can defer Windows 10 updates for a period of days and run in Off Hours (See update settings).
So set your Windows 10 update parameters and make sure applications have been closed and data saved first.
-
1This answer does not really answer the author's question. They are not looking to prevent updates from being installed entirely. They are looking to prevent an automatic reboot while a specific application is running. That specific action is indeed possible.– RamhoundNov 18, 2019 at 15:27
-
I am just providing the easiest way out to ensure all works well. There may be more complicated ways, but the above answer is a workable way I use all the time.– JohnNov 18, 2019 at 15:32
-
Downvoting good information is a very bad practice. There is more than one way to do things which you fail to recognize– JohnNov 18, 2019 at 16:11