Advertisement
mattb47

Lock-Windows-Feature-Release.bat

Jan 17th, 2025
558
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Winbatch 1.08 KB | Source Code | 0 0
  1. @echo off
  2. rem
  3. rem Lock Windows to a particular feature release
  4. rem By Matthew Borcherding, matt@borchtech.com
  5. rem 12/14/2024
  6. rem
  7. rem Based on info from:
  8. rem https://www.tenforums.com/installation-upgrade/185952-blocking-windows-11-upgrade.html
  9. rem https://answers.microsoft.com/en-us/windows/forum/all/anyway-to-not-update-to-24h2-but-still-get/765ba31f-a9c7-45af-99b5-a701cf624ceb
  10. rem
  11.  
  12.    setlocal
  13.  
  14. rem
  15. rem Set the release level to lock
  16. rem
  17.  
  18.    set release-level=23H2
  19.  
  20. rem
  21. rem Update registry
  22. rem
  23.  
  24.    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v ProductVersion /t REG_SZ /d "Windows 11" /f > nul
  25.    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v TargetReleaseVersion /t REG_DWORD /d 1 /f > nul
  26.    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v TargetReleaseVersionInfo  /t REG_SZ /d %release-level% /f > nul
  27.    
  28. rem
  29. rem Restart Windows Update service
  30. rem
  31.  
  32.    net stop wuauserv
  33.    net start wuauserv
  34.    
  35.    gpupdate /force
  36.    
  37.    echo Windows now locked to feature release %release-level%.
  38.    echo.
  39.    
  40. :end
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement