@echo off
:: Windows10 Upgrade Ad Remover
::
:: http://www.ghacks.net/2015/04/17/how-to-remove-windows-10-upgrade-updates-in-windows-7-and-8/
:: http://www.gulli.com/news/26452-microsoft-integriert-datensammel-funktionen-auch-in-win-7-und-win-8-update-2015-08-26
:: http://superuser.com/questions/922068/how-to-disable-the-get-windows-10-icon-shown-in-the-notification-area-tray
::
:: Updates (2nd block are some big brother updates)
:: KB3035583 [w7/8] Get Windows 10 App (Advertisment)
:: KB2952664 [w7] Update compatibility check for w10
:: KB2976978 [w8] Update compatibility ckeck for w10
:: KB3021917 [w7] Performance check for w10 update
:: KB3044374 [w8] Enables upgrade from the current version to a later version
:: KB2990214 [w7] Enables upgrade from the current version to a later version
::
:: KB3068708 [w7/8] Update for customer experience and diagnostic telemetry
:: KB3022345 [w7/8] Update for customer experience and diagnostic telemetry
:: KB3075249 [w7/8] Update that adds telemetry points to consent.exe in Windows 8.1 and Windows 7
:: KB3080149 [w7/8] Update for customer experience and diagnostic telemetry
:: Check for administrative rights
net session > nul 2>&1
if %errorlevel% NEQ 0 (
echo Please run in administrative terminal.
echo.
exit /b
)
:: Variables
setlocal EnableDelayedExpansion
set log=%cd%\w10UpgradeAdRemover.log
set hotfixes=KB3035583,KB2952664,KB2976978,KB3021917,KB3044374,KB2990214
:: set hotfixes=KB3035583,KB2952664,KB2976978,KB3021917,KB3044374,KB2990214,KB3068708,KB3022345,KB3075249,KB3080149
:: Query for installed updates and uninstall existing ones
echo Query for installed hotfixes...
for /f "tokens=1,2,3,4,5 skip=3 delims= " %%a in ('powershell -Command "get-hotfix -id %hotfixes%"') do (
set id=%%c
set id=!id:~-7!
echo Uninstalling KB!id!
wusa /uninstall /KB:!id! /quiet /norestart /log:!log!
)
echo.
:: Kill the W10 App with fire
echo Blocking GWX in registry...
echo.
reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\GWX
reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\GWX /v DisableGWX /t REG_DWORD /d 1
reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v DisableOSUpgrade /t REG_DWORD /d 1
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /v AllowOSUpgrade /t REG_DWORD /d 0
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /v ReservationsAllowed /t REG_DWORD /d 0
echo Please hide deleted updates in the new window...
echo (Hit any key to continue)
echo.
pause > nul
wuapp /detectnow
exit /b
:: In case you want to install the upgrade after all, change the registry values to:
::
:: reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\GWX /f
:: reg relete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v DisableOSUpgrade /f
:: reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /v AllowOSUpgrade /t REG_DWORD /d 1
:: reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /v ReservationsAllowed /t REG_DWORD /d 2
::
:: and unhide the hidden updates.