# Decline Windows 11 upgrade

**URL:** <https://community.syncromsp.com/t/decline-windows-11-upgrade/3744>\
**Category:** Staff Picks\
**Tags:** staff-picks\
**Created:** [March 4, 2022, 5:07am UTC](https://community.syncromsp.com/t/decline-windows-11-upgrade/3744 "2022-03-04T05:07:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![isaacg](https://sea3.discourse-cdn.com/syncro/user_avatar/community.syncromsp.com/isaacg/32/658_2.png) [@isaacg](https://community.syncromsp.com/u/isaacg)\
**Post date:** [March 4, 2022, 5:07am UTC](https://community.syncromsp.com/t/decline-windows-11-upgrade/3744/1 "2022-03-04T05:07:07Z")

</div>

So it looks like the jerks at Microsoft aren’t offering 21H2 if the machine is Windows 11 capable. You have to go into WU and click ‘Stay on Windows 10 for now’ and then it finds 21H2.

This seems to work to decline (actual value seems to vary but just using 1 seems to be fine). Also gets rid of the tray icon prompt (probably will need to reboot or check for Windows Updates for registry change to be noticed).

`reg add HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /f /v SvOfferDeclined /t REG_QWORD /d 1`

Other items that may help prevent unintended upgrades:

```auto
reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v DisableOSUpgrade /t REG_DWORD /d 1
reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v ProductVersion /t REG_DWORD /d 10
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /f /v AllowOSUpgrade /t REG_DWORD /d 0
reg add HKLM\SOFTWARE\Policies\Microsoft\WindowsStore /f /v DisableOSUpgrade /t REG_DWORD /d 1
reg add HKLM\SYSTEM\Setup\UpgradeNotification /f /v UpgradeAvailable /t REG_DWORD /d 0
# Uninstall Windows PC Health Check
Start-Process -FilePath msiexec.exe -ArgumentList "/x {B1E7D0FD-7CFE-4E0C-A5DA-0F676499DB91} /qn" -Wait
# Prevent Windows PC Health Check install
reg add HKLM\SOFTWARE\Microsoft\PCHC /f /v PreviousUninstall /t REG_DWORD /d 1

```

---

<div class="post-metadata">

**Author:** ![jeff](https://sea3.discourse-cdn.com/syncro/user_avatar/community.syncromsp.com/jeff/32/176_2.png) [@jeff](https://community.syncromsp.com/u/jeff)\
**Post date:** [March 4, 2022, 4:04pm UTC](https://community.syncromsp.com/t/decline-windows-11-upgrade/3744/2 "2022-03-04T16:04:21Z")

</div>

Thanks @isaacg. Here is a script cobbled together with block and unblock options. This should make it easy to schedule with defaults and for the techs to run manually if they need to unblock. I like to have Install and Uninstall in the same scripts now that my list of scripts is getting long.

```auto
Import-Module $env:SyncroModule
## Add Syncro dropdown variable "mode" with "block" (default) and "unblock" options
## Add Syncro dropdown variable "TargetVersion" with "21H1", "21H2", etc. options

if ($mode -eq "block"){
    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v TargetReleaseVersion /t REG_DWORD /d 1
    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v TargetReleaseVersionInfo /t REG_SZ /d $TargetVersion
    
    reg add HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /f /v SvOfferDeclined /t REG_QWORD /d 1

    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v DisableOSUpgrade /t REG_DWORD /d 1
    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v ProductVersion /t REG_DWORD /d 10
    reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /f /v AllowOSUpgrade /t REG_DWORD /d 0
    reg add HKLM\SOFTWARE\Policies\Microsoft\WindowsStore /f /v DisableOSUpgrade /t REG_DWORD /d 1
    reg add HKLM\SYSTEM\Setup\UpgradeNotification /f /v UpgradeAvailable /t REG_DWORD /d 0
    # Uninstall Windows PC Health Check
    Start-Process -FilePath msiexec.exe -ArgumentList "/x {B1E7D0FD-7CFE-4E0C-A5DA-0F676499DB91} /qn" -Wait
    # Prevent Windows PC Health Check install
    reg add HKLM\SOFTWARE\Microsoft\PCHC /f /v PreviousUninstall /t REG_DWORD /d 1
    
}

if ($mode -eq "unblock") {
    # Undo Set Windows to not upgrade past 21H2 (prevent Windows 11 auto-upgrade)
    reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v TargetReleaseVersion
    reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v TargetReleaseVersionInfo
    # Undo Other possible prevention
    reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v DisableOSUpgrade
    reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v ProductVersion
    reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /f /v AllowOSUpgrade
    reg delete HKLM\SOFTWARE\Policies\Microsoft\WindowsStore /f /v DisableOSUpgrade
    reg delete HKLM\SYSTEM\Setup\UpgradeNotification /f /v UpgradeAvailable
    # Undo Prevent Windows PC Health Check install
    reg delete HKLM\SOFTWARE\Microsoft\PCHC /f /v PreviousUninstall
}

```

---

<div class="post-metadata">

**Author:** ![dasirrine](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@dasirrine](https://community.syncromsp.com/u/dasirrine)\
**Post date:** [December 13, 2022, 5:47pm UTC](https://community.syncromsp.com/t/decline-windows-11-upgrade/3744/4 "2022-12-13T17:47:57Z")

</div>

Since this has become a hot topic again, here’s a few updates and corrections:

```auto
Import-Module $env:SyncroModule
## REQUIRES Syncro dropdown variable "mode" with "block" (default) and "unblock"
## REQUIRES Syncro dropdown variable "TargetVersion" with "21H1", "21H2", etc.

if ($mode -eq "block"){

	# limit the Target Version (e.g. 22H2)
	reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v TargetReleaseVersion /t REG_DWORD /d 1
    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v TargetReleaseVersionInfo /t REG_SZ /d $TargetVersion

    # prevent upgrade offer from displaying
    reg add HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /f /v SvOfferDeclined /t REG_QWORD /d 1

	# Other possible prevention
    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v DisableOSUpgrade /t REG_DWORD /d 1
    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v ProductVersion /t REG_DWORD /d 10
    reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /f /v AllowOSUpgrade /t REG_DWORD /d 0
    reg add HKLM\SOFTWARE\Policies\Microsoft\WindowsStore /f /v DisableOSUpgrade /t REG_DWORD /d 1
    reg add HKLM\SYSTEM\Setup\UpgradeNotification /f /v UpgradeAvailable /t REG_DWORD /d 0

    # Uninstall Windows PC Health Check
    Start-Process -FilePath msiexec.exe -ArgumentList "/x {B1E7D0FD-7CFE-4E0C-A5DA-0F676499DB91} /qn" -Wait
	Start-Process -FilePath msiexec.exe -ArgumentList "/x {6798C408-2636-448C-8AC6-F4E341102D27} /qn" -Wait

    # Prevent Windows PC Health Check install
    reg add HKLM\SOFTWARE\Microsoft\PCHC /f /v PreviousUninstall /t REG_DWORD /d 1
}

if ($mode -eq "unblock") {

    # Undo Set Windows to not upgrade past "Target Version"
    reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v TargetReleaseVersion
    reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v TargetReleaseVersionInfo
	
	# Undo prevent upgrade offer from displaying
    reg delete HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /f /v SvOfferDeclined

    # Undo Other possible prevention
    reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v DisableOSUpgrade
    reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v ProductVersion
    reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /f /v AllowOSUpgrade
    reg delete HKLM\SOFTWARE\Policies\Microsoft\WindowsStore /f /v DisableOSUpgrade
    reg delete HKLM\SYSTEM\Setup\UpgradeNotification /f /v UpgradeAvailable

    # Undo Prevent Windows PC Health Check install
    reg delete HKLM\SOFTWARE\Microsoft\PCHC /f /v PreviousUninstall
}

```

---

<div class="post-metadata">

**Author:** ![jim2](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jim2](https://community.syncromsp.com/u/jim2)\
**Post date:** [December 22, 2022, 5:03pm UTC](https://community.syncromsp.com/t/decline-windows-11-upgrade/3744/5 "2022-12-22T17:03:14Z")

</div>

How do I determine if I should use 21H21 or 21H2?

---

<div class="post-metadata">

**Author:** ![isaacg](https://sea3.discourse-cdn.com/syncro/user_avatar/community.syncromsp.com/isaacg/32/658_2.png) [@isaacg](https://community.syncromsp.com/u/isaacg)\
**Post date:** [December 22, 2022, 8:54pm UTC](https://community.syncromsp.com/t/decline-windows-11-upgrade/3744/6 "2022-12-22T20:54:42Z")

</div>

21H1 is EOL, You want 21H2 or 22H2. I’ve haven’t seen any reason not to be on 22H2

---

<div class="post-metadata">

**Author:** ![jim2](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jim2](https://community.syncromsp.com/u/jim2)\
**Post date:** [December 30, 2022, 10:44pm UTC](https://community.syncromsp.com/t/decline-windows-11-upgrade/3744/7 "2022-12-30T22:44:54Z")

</div>

Thanks!  
Minmum20 characters

---

<div class="post-metadata">

**Author:** ![jason5](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@jason5](https://community.syncromsp.com/u/jason5)\
**Post date:** [March 22, 2023, 12:53am UTC](https://community.syncromsp.com/t/decline-windows-11-upgrade/3744/8 "2023-03-22T00:53:02Z")

</div>

Thanks for posting this. I’m a bit confused with the variable. I need to use this script, and create 2 variables? I’m kinda new here; can you walk me through it? Thanks in advance!!

---

<div class="post-metadata">

**Author:** ![dasirrine](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@dasirrine](https://community.syncromsp.com/u/dasirrine)\
**Post date:** [March 22, 2023, 1:57am UTC](https://community.syncromsp.com/t/decline-windows-11-upgrade/3744/9 "2023-03-22T01:57:08Z")

</div>

The script was written to give you the option of choosing your target build of Windows 10, e.g. if you have some reason to stop updates at a previous version like 21H2. The other variable allows the script to block the upgrade to Windows 11 or unblock it whenever you decide you want the upgrade to proceed. [For example, I just had a client last month who finally decided to upgrade to Windows 10 from 7 and couldn’t because I had blocked it years ago!]

So to use this script, create a new script in Syncro, copy and paste the code, then create runtime variables for “mode” and “TargetVersion”.

 ![image](https://us1.discourse-cdn.com/syncro/original/2X/b/bbe9c65a722aaa462ae78f898548c631730a1685.png)

The values of those variables will then be as specified, “block” or “unblock” and the target version of Windows 10 you want, e.g. “21H2” or “22H2”.

 ![image](https://us1.discourse-cdn.com/syncro/original/2X/2/2fe81dee6c0bfb1f98a94c61a60289f918e4c37d.png)

Does that help?
