Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Default Prevent Windows 10 Upgrade
- This is minimal guide to handle and prevent the Windows 10 Upgrade on Windows 7 (applies to Windows 8.1 as well)
- that also includes the so called Telemetry updates
- there is two basic ways for that:
- 1) block the upgrade itself, keeping related updates installed
- 2) remove any updates that would facilitate the upgrade
- download the sample batch scripts: here or here
- = Block related Windows 10 upgrade and telemetry settings =
- # Advantages:
- - get use of latest Windows Update Client which solves the high CPU/Memory scan issue, and perhaps the slow/stuck scan issue
- - seemingly make the related updates harmless (disabled), thus can safely enable Automatic Updates (as long as 'Recommended' updates option is off)
- - do not need to keep track of future related updates, or if a new updates version released
- # Disadvantages:
- - no one would know what microsoft could come up with, so some blocking settings may get reverted by future updates
- but you can always run/schedule the blocking script after any updating operation just in case
- # Script:
- extract W10-Block.cmd of download pack, then right-click and select 'Run as administrator'
- or copy the following and save as W10-Block.cmd
- Spoiler:
- Code:
- @echo off
- %windir%\system32\reg.exe query "HKU\S-1-5-19" 1>nul 2>nul || goto :eof
- echo.
- echo Processing Windows10 blocking tweaks
- reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\Gwx /v DisableGwx /t REG_DWORD /d 1 /f >nul 2>&1
- reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v DisableOSUpgrade /t REG_DWORD /d 1 /f >nul 2>&1
- reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /v AllowOSUpgrade /t REG_DWORD /d 0 /f >nul 2>&1
- reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /v ReservationsAllowed /t REG_DWORD /d 0 /f >nul 2>&1
- reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /f /v IncludeRecommendedUpdates /t REG_DWORD /d 0 >nul 2>&1
- reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Appraiser" /v HaveUploadedForTarget /t REG_DWORD /d 1 /f >nul 2>&1
- reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\AIT" /v AITEnable /t REG_DWORD /d 0 /f >nul 2>&1
- reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\ClientTelemetry" /v DontRetryOnError /t REG_DWORD /d 1 /f >nul 2>&1
- reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\ClientTelemetry" /v IsCensusDisabled /t REG_DWORD /d 1 /f >nul 2>&1
- reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\ClientTelemetry" /v TaskEnableRun /t REG_DWORD /d 1 /f >nul 2>&1
- reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags" /v UpgradeEligible /f >nul 2>&1
- reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v OSUpgradePendingReboot /f >nul 2>&1
- reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" /f >nul 2>&1
- reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Volatile" /v OSUpgradeStartTime /f >nul 2>&1
- reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" /v AutoRebootDelay /f >nul 2>&1
- reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" /v KickoffDownload /f >nul 2>&1
- reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" /v KickoffUpgrade /f >nul 2>&1
- reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade\State" /f >nul 2>&1
- reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Reporting\EventCache.v2\Legacy\9482f4b4-e343-43b6-b170-9a65bc822c77" /f >nul 2>&1
- sc.exe config DiagTrack start= disabled >nul 2>&1
- sc.exe stop DiagTrack >nul 2>&1
- schtasks /Change /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE >nul 2>&1
- schtasks /Change /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /DISABLE >nul 2>&1
- schtasks /Change /TN "\Microsoft\Windows\Application Experience\AitAgent" /DISABLE >nul 2>&1
- schtasks /Change /TN "\Microsoft\Windows\Setup\gwx\launchtrayprocess" /DISABLE >nul 2>&1
- schtasks /Change /TN "\Microsoft\Windows\Setup\gwx\refreshgwxconfig" /DISABLE >nul 2>&1
- schtasks /Change /TN "\Microsoft\Windows\Setup\gwx\refreshgwxconfigandcontent" /DISABLE >nul 2>&1
- schtasks /Change /TN "\Microsoft\Windows\Setup\gwx\refreshgwxcontent" /DISABLE >nul 2>&1
- schtasks /Delete /F /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" >nul 2>&1
- schtasks /Delete /F /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater" >nul 2>&1
- schtasks /Delete /F /TN "\Microsoft\Windows\Application Experience\AitAgent" >nul 2>&1
- schtasks /Delete /F /TN "\Microsoft\Windows\Setup\gwx\launchtrayprocess" >nul 2>&1
- schtasks /Delete /F /TN "\Microsoft\Windows\Setup\gwx\refreshgwxconfig" >nul 2>&1
- schtasks /Delete /F /TN "\Microsoft\Windows\Setup\gwx\refreshgwxconfigandcontent" >nul 2>&1
- schtasks /Delete /F /TN "\Microsoft\Windows\Setup\gwx\refreshgwxcontent" >nul 2>&1
- (echo schtasks /Change /TN "\Microsoft\Windows\Setup\GWXTriggers\refreshgwxconfig-B" /DISABLE
- echo schtasks /Change /TN "\Microsoft\Windows\Setup\GWXTriggers\Logon-5d" /DISABLE
- echo schtasks /Change /TN "\Microsoft\Windows\Setup\GWXTriggers\Logon-URT" /DISABLE
- echo schtasks /Change /TN "\Microsoft\Windows\Setup\GWXTriggers\MachineUnlock-5d" /DISABLE
- echo schtasks /Change /TN "\Microsoft\Windows\Setup\GWXTriggers\OutOfIdle-5d" /DISABLE
- echo schtasks /Change /TN "\Microsoft\Windows\Setup\GWXTriggers\OutOfSleep-5d" /DISABLE
- echo schtasks /Change /TN "\Microsoft\Windows\Setup\GWXTriggers\ScheduleUpgradeReminderTime" /DISABLE
- echo schtasks /Change /TN "\Microsoft\Windows\Setup\GWXTriggers\ScheduleUpgradeTime" /DISABLE
- echo schtasks /Change /TN "\Microsoft\Windows\Setup\GWXTriggers\Telemetry-4xd" /DISABLE
- echo schtasks /Change /TN "\Microsoft\Windows\Setup\GWXTriggers\Time-5d" /DISABLE
- echo schtasks /Delete /F /TN "\Microsoft\Windows\Setup\GWXTriggers\refreshgwxconfig-B"
- echo schtasks /Delete /F /TN "\Microsoft\Windows\Setup\GWXTriggers\Logon-5d"
- echo schtasks /Delete /F /TN "\Microsoft\Windows\Setup\GWXTriggers\Logon-URT"
- echo schtasks /Delete /F /TN "\Microsoft\Windows\Setup\GWXTriggers\MachineUnlock-5d"
- echo schtasks /Delete /F /TN "\Microsoft\Windows\Setup\GWXTriggers\OutOfIdle-5d"
- echo schtasks /Delete /F /TN "\Microsoft\Windows\Setup\GWXTriggers\OutOfSleep-5d"
- echo schtasks /Delete /F /TN "\Microsoft\Windows\Setup\GWXTriggers\ScheduleUpgradeReminderTime"
- echo schtasks /Delete /F /TN "\Microsoft\Windows\Setup\GWXTriggers\ScheduleUpgradeTime"
- echo schtasks /Delete /F /TN "\Microsoft\Windows\Setup\GWXTriggers\Telemetry-4xd"
- echo schtasks /Delete /F /TN "\Microsoft\Windows\Setup\GWXTriggers\Time-5d")>%windir%\Tasks.cmd
- SCHTASKS /Create /F /RU "SYSTEM" /RL HIGHEST /SC HOURLY /TN Tasks /TR "cmd /c %windir%\Tasks.cmd" >nul 2>&1
- SCHTASKS /Run /I /TN Tasks >nul 2>&1
- TIMEOUT /T 5 >nul 2>&1
- SCHTASKS /Delete /F /TN Tasks >nul 2>&1
- del /f /q %windir%\Tasks.cmd >nul 2>&1
- Note:
- - some of the commands may return error (task or registry key not found), you can ignore that
- # Schedule task:
- to make sure the blocking settings are always set, you can create a schedule task to run the script at logon as example
- 1- copy W10-Block.cmd to C:\Windows directory
- 2- open command prompt as administrator and execute:
- Code:
- SCHTASKS /Create /F /RU "SYSTEM" /RL HIGHEST /SC ONLOGON /TN BlockW10 /TR "cmd /c %windir%\W10-Block.cmd"
- SCHTASKS /Run /I /TN BlockW10
- = Remove related Windows 10 upgrade and telemetry updates =
- # Advantages:
- - safely make sure the upgrade do not sneak in
- - get rid of any telemetry effects (tracking, spying)
- # Disadvantages:
- - needs constant tracking of all future updates to determine which are related or harmful
- - Automatic Updates can cause related updates to be installed, specially for new versions of known updates
- - skipping latest Windows Update Client which solves the slow/high-resources scans
- 1) Uninstall updates:
- extract W10-Uninstall.cmd of download pack, then right-click and select 'Run as administrator'
- or copy the following and save as W10-Uninstall.cmd
- Spoiler:
- Code:
- @echo off
- set list=(2952664,2976978,2990214,3021917,3022345,3035583,3044374,3050265,3050267,3064683,3068708,3072318,3075249,3075851,3075853,3080149,3083324,3083325,3083710,3083711,3102810,3102812,3112336,3112343,3121461,3123862,3135445,3135449,3138612,3138615,3150513)
- %windir%\system32\reg.exe query "HKU\S-1-5-19" 1>nul 2>nul || goto :eof
- setlocal enableextensions
- setLocal EnableDelayedExpansion
- cd /d "%~dp0"
- set name=
- echo.
- echo Checking installed packages...
- Dism /English /Online /Get-Packages>Packs.txt
- for /d %%G in %list% do (
- for /f "tokens=3 delims=: " %%i in ('findstr %%G Packs.txt') do echo %%i>>ToRemove.txt
- )
- if not exist ToRemove.txt echo.&echo Non of the specified updates is found installed&goto :end
- for /f %%i in (ToRemove.txt) do (call set /a num+=1)
- for /f %%i in (ToRemove.txt) do call :setcount %%i
- for /L %%j in (1, 1, %num%) do (
- set name=!name! /PackageName:!PK%%j!
- )
- Dism /Online /NoRestart /Remove-Package %name%
- del ToRemove.txt
- echo.
- echo #########################################################
- if exist "%windir%\winsxs\pending.xml" echo.&echo System restart is required.
- :end
- del Packs.txt
- echo.
- echo.
- echo Press any key to Exit
- pause >nul
- exit
- :setcount
- set /a count+=1
- set PK%count%=%1
- goto :eof
- Notes:
- - the script will need updating when new related updates are released, by appending KB numbers to the list in second line
- - for Windows 8.1, if the OS is installed using latest released ISO/ESD (December 2014), it contain a version of KB2976978 that is permanent and can't be removed
- the only workaround left is to disable/delete its related tasks:
- Spoiler:
- Code:
- schtasks /Change /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE
- schtasks /Change /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /DISABLE
- schtasks /Change /TN "\Microsoft\Windows\Application Experience\AitAgent" /DISABLE
- schtasks /Delete /F /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
- schtasks /Delete /F /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater"
- schtasks /Delete /F /TN "\Microsoft\Windows\Application Experience\AitAgent"
- 2) Hide updates:
- extract W10-Hide.cmd of download pack, then right-click and select 'Run as administrator'
- or copy the following and save as W10-Hide.cmd
- Spoiler:
- Code:
- @echo off
- set "list=2952664 2976978 2990214 3021917 3022345 3035583 3044374 3050265 3050267 3064683 3068708 3072318 3075249 3075851 3075853 3080149 3083324 3083325 3083710 3083711 3102810 3102812 3112336 3112343 3121461 3123862 3135445 3135449 3138612 3138615 3150513"
- %windir%\system32\reg.exe query "HKU\S-1-5-19" 1>nul 2>nul || goto :eof
- cd /d "%~dp0"
- (echo Dim objArgs
- echo Set objArgs ^= Wscript.Arguments
- echo Dim updateSession, updateSearcher
- echo Set updateSession ^= CreateObject^("Microsoft.Update.Session"^)
- echo Set updateSearcher ^= updateSession.CreateUpdateSearcher^(^)
- echo Wscript.Stdout.Write "Checking for updates..."
- echo Dim searchResult
- echo Set searchResult ^= updateSearcher.Search^("IsInstalled=0"^)
- echo Dim update, kbArticleId, index, index2
- echo WScript.Echo " "
- echo WScript.Echo " "
- echo For index ^= ^0 To searchResult.Updates.Count ^- ^1
- echo Set update ^= searchResult.Updates.Item^(index^)
- echo For index2 ^= ^0 To update.KBArticleIDs.Count - ^1
- echo kbArticleId ^= update.KBArticleIDs^(index2^)
- echo For Each hotfixId in objArgs
- echo If kbArticleId ^= hotfixId Then
- echo If update.IsHidden ^= False Then
- echo WScript.Echo "Hiding update: " ^& update.Title
- echo update.IsHidden ^= True
- echo Else
- echo WScript.Echo "Already hidden: " ^& update.Title
- echo End If
- echo End If
- echo Next
- echo Next
- echo Next
- echo.)>Hide.vbs
- echo.
- cscript.exe //Nologo Hide.vbs %list%
- echo.
- echo.
- echo Press any key to Exit
- pause >nul
- del Hide.vbs
- exit
- Notes:
- - the script will need updating when new related updates are released, by appending KB numbers to the list in second line
- - the hiding operation depend on checking updates using WU api, therefore the process may take some time specially on fresh system with no updates installed
- - thanks to MysTikAL3 for original HideUpdates.vbs
- 3) Extra:
- if you suspect or found that there upgrade related files downloaded, you may run these commands in admin cmd to clean them up
- Spoiler:
- Code:
- del /f /s /q %windir%\SoftwareDistribution\Download\* >nul 2>&1
- for /f %i in ('"dir /s /b /ad %systemroot%\SoftwareDistribution\Download" 2^>nul') do rmdir /S /Q %i 1>nul 2>nul
- takeown /f %SystemDrive%\$WINDOWS.~BT\* /R /A >nul 2>&1
- icacls %SystemDrive%\$WINDOWS.~BT\*.* /grant *S-1-5-32-544:F /T >nul 2>&1
- rmdir /S /Q %SystemDrive%\$WINDOWS.~BT >nul 2>&1
- takeown /f %SystemDrive%\$Windows.~WS\* /R /A >nul 2>&1
- icacls %SystemDrive%\$Windows.~WS\*.* /grant *S-1-5-32-544:F /T >nul 2>&1
- rmdir /S /Q %SystemDrive%\$Windows.~WS >nul 2>&1
- - You may follow these changelogs to track which updates are Windows10 related: W8.1 - W7
- - See here for more info on what KB update is for
- Last edited by abbodi1406; 11 May 2016 at 14:52. Reason: added 3150513
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement