0

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?

4

2 Answers 2

0

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:

1
  • 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?
    – Deniz
    Nov 19, 2019 at 11:13
-1

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.

3
  • 1
    This 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.
    – Ramhound
    Nov 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.
    – John
    Nov 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
    – John
    Nov 18, 2019 at 16:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .