Skip to content

How to Defer Feature Updates in Batch Script

Learn how to use a Batch script to defer Windows feature updates (like Windows 10/11 version upgrades) via registry settings while keeping security patches active.

Feature Updates in Windows (like the jump from Windows 10 version 21H2 to 22H2) bring new capabilities but also represent significant changes to the operating system's core. For businesses and power users, it is often safer to wait several months before installing these large updates to ensure that any initial bugs have been patched. By using a Batch script to "defer" these updates, you can stay on your current, stable version of Windows while still receiving essential security patches. This guide explains how to use the registry to configure feature update deferral periods.

Why Defer Feature Updates?

  • Stability: Ensuring that new features don't break mission-critical software or custom drivers.
  • Controlled Deployment: Coordinating the upgrade of multiple machines at a time that suits your schedule.
  • Bandwidth Management: Preventing several machines from downloading a multi-gigabyte update simultaneously on a slow network.

Understanding the Deferral Registry Keys

Windows manages deferral settings through the Policy CSP (Configuration Service Provider), which we can modify via the registry.

The key location is: HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate

The primary values are:

  • DeferFeatureUpdates: Enables (1) or disables (0) the deferral policy. The period value is ignored unless this is set to 1.
  • DeferFeatureUpdatesPeriodInDays: The number of days to wait (0–365).
  • DeferQualityUpdatesPeriodInDays: Optional companion value to briefly delay security patches (0–30).

Creating the Update Deferral Script

The following script configures Windows to wait a set number of days (e.g., 90 days) before acknowledging or installing a new Feature Update.

@echo off
setlocal EnableDelayedExpansion

set "REG_PATH=HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"
set "FEATURE_DAYS=90"
set "QUALITY_DAYS=7"

echo ============================================================
echo   Feature Update Deferral Configurator
echo ============================================================

:: 1. Check for Administrative Privileges
net session >nul 2>&1
if %errorlevel% neq 0 (
    echo [ERROR] This script must be run as Administrator.
    pause
    exit /b 1
)

:: 2. Validate deferral values
if !FEATURE_DAYS! gtr 365 (
    echo [ERROR] Feature deferral cannot exceed 365 days.
    pause
    exit /b 1
)
if !QUALITY_DAYS! gtr 30 (
    echo [ERROR] Quality deferral cannot exceed 30 days.
    pause
    exit /b 1
)

:: 3. Ensure the parent key exists
reg add "%REG_PATH%" /f >nul 2>&1

:: 4. Enable the deferral policy (must be set BEFORE the period value)
echo [PROCESS] Enabling the Feature Update deferral policy...
reg add "%REG_PATH%" /v "DeferFeatureUpdates" /t REG_DWORD /d 1 /f >nul 2>&1
if %errorlevel% neq 0 (
    echo [ERROR] Failed to set DeferFeatureUpdates.
    pause
    exit /b 1
)

:: 5. Set the Deferral Period
echo [PROCESS] Setting Feature Update deferral to %FEATURE_DAYS% days...
reg add "%REG_PATH%" /v "DeferFeatureUpdatesPeriodInDays" /t REG_DWORD /d %FEATURE_DAYS% /f >nul 2>&1
if %errorlevel% neq 0 (
    echo [ERROR] Failed to set DeferFeatureUpdatesPeriodInDays.
    pause
    exit /b 1
)

:: 6. Optional: Defer Quality Updates (Security) for a short buffer
echo [PROCESS] Setting Quality Update deferral to %QUALITY_DAYS% days...
reg add "%REG_PATH%" /v "DeferQualityUpdatesPeriodInDays" /t REG_DWORD /d %QUALITY_DAYS% /f >nul 2>&1
if %errorlevel% neq 0 (
    echo [ERROR] Failed to set DeferQualityUpdatesPeriodInDays.
    pause
    exit /b 1
)

:: 7. Verify all values by reading them back
echo.
echo [VERIFY] Current deferral settings:
for %%V in (DeferFeatureUpdates DeferFeatureUpdatesPeriodInDays DeferQualityUpdatesPeriodInDays) do (
    reg query "%REG_PATH%" /v "%%V" 2>nul | findstr /I "%%V"
)

echo.
echo [SUCCESS] Deferral policies applied successfully.
echo          Feature updates deferred by %FEATURE_DAYS% days.
echo          Quality updates deferred by %QUALITY_DAYS% days.
echo ============================================================
pause

Removing the Deferral Policy

Any script that modifies system policy should have a counterpart that reverses the change. This script restores default behavior.

@echo off
setlocal

set "REG_PATH=HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"

echo ============================================================
echo   Remove Feature Update Deferral Policy
echo ============================================================

:: Check for Administrative Privileges
net session >nul 2>&1
if %errorlevel% neq 0 (
    echo [ERROR] This script must be run as Administrator.
    pause
    exit /b 1
)

:: Remove deferral values
for %%V in (DeferFeatureUpdates DeferFeatureUpdatesPeriodInDays DeferQualityUpdatesPeriodInDays) do (
    reg delete "%REG_PATH%" /v "%%V" /f >nul 2>&1
)

echo [SUCCESS] All deferral policies removed.
echo          Windows will now offer Feature Updates normally.
echo ============================================================
pause

Common Pitfalls and How to Avoid Them

Setting the Period Without Enabling the Policy

The DeferFeatureUpdatesPeriodInDays value is ignored unless DeferFeatureUpdates is set to 1. Many scripts set only the period and wonder why deferral has no effect.

Wrong Way:

:: Setting the period but forgetting the enable flag
reg add "%REG_PATH%" /v "DeferFeatureUpdatesPeriodInDays" /t REG_DWORD /d 90 /f
:: Windows ignores this because DeferFeatureUpdates is not set to 1

Correct Way:

:: Enable the policy first, then set the period
reg add "%REG_PATH%" /v "DeferFeatureUpdates" /t REG_DWORD /d 1 /f >nul 2>&1
reg add "%REG_PATH%" /v "DeferFeatureUpdatesPeriodInDays" /t REG_DWORD /d 90 /f >nul 2>&1

Misunderstanding "Pause" vs "Defer"

"Pausing" updates (available in Settings) is temporary and lasts only 35 days. "Deferring" via this script is a persistent policy that can last up to a full year.

Windows Home Edition Limitations

Microsoft has restricted many deferral policies in Windows Home Edition. These registry keys are most effective on Windows 10/11 Pro, Enterprise, and Education versions. On Home, the keys may be silently ignored.

Checking Only the Last %errorlevel%

If your script runs multiple reg add commands but only checks the exit code once at the end, a failure on any earlier command is silently hidden.

Wrong Way:

reg add "%REG_PATH%" /v "DeferFeatureUpdates" /t REG_DWORD /d 1 /f
reg add "%REG_PATH%" /v "DeferFeatureUpdatesPeriodInDays" /t REG_DWORD /d 90 /f
reg add "%REG_PATH%" /v "DeferQualityUpdatesPeriodInDays" /t REG_DWORD /d 7 /f
:: Only reflects the last command
if %errorlevel% equ 0 echo [SUCCESS]

Correct Way: Check %errorlevel% immediately after each critical command, as shown in the main script above.

The Target Version Alternative

Since Windows 10/11 version 2004, Microsoft supports a "Target Release Version" model. Instead of deferring by a number of days, you can lock your machine to a specific Windows version.

Best Practices for Patch Management

  1. Don't Defer Forever: Deferring for 30–90 days is standard. Deferring for 365 days often means you miss important platform improvements and risk running an unsupported version.
  2. Monitor End of Service: Every version of Windows has an end-of-service date. If you defer too long, your current version will stop receiving even security updates. Check Microsoft's Lifecycle page for dates.
  3. Audit Current Settings: Include a read-back step in your deployment scripts so you have a record of what was applied:
    echo --- Deferral Audit: %COMPUTERNAME% - %date% ---
    for %%V in (
        DeferFeatureUpdates
        DeferFeatureUpdatesPeriodInDays
        DeferQualityUpdatesPeriodInDays
        TargetReleaseVersion
        TargetReleaseVersionInfo
    ) do (
        reg query "%REG_PATH%" /v "%%V" 2>nul | findstr /I "%%V"
    )
  4. Quality Update Limits: The maximum deferral for Quality Updates is 30 days, not 365. Setting a value above 30 may be silently clamped or ignored.

Conclusion

Deferring feature updates via Batch script is a proactive way to manage system stability and prevent the disruption that large OS upgrades can cause. By leveraging the Windows registry to set specific deferral days and target versions, you can ensure that your environment remains consistent and predictable. This professional approach to lifecycle management allows you to benefit from a secure system while choosing a timeline for new features that aligns with your specific testing and production requirements.

Navigation