Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove Windows 7/8/8.1 telemetry
@echo off
title "Disable Windows 7/8/8.1 Telemetry"
endlocal & setlocal EnableDelayedExpansion
rem Script created by <github.com/tarampampam> # 2015
rem Github: <https://gist.github.com/tarampampam/a0db45fb0de5976300b1>
rem OS: Windows 7/8/8.1
rem Version 0.2.14
echo.
echo ***************************************************************************
echo * *
echo * Disable Windows 7/8/8.1 Telemetry (+bonus) service *
echo * *
echo ***************************************************************************
echo * *
echo * Script support arguments: *
echo * *
echo * -kb ^| -hotfixes Do NOT uninstall updates *
echo * -d ^| -disable Do NOT disable updates *
echo * -t ^| -tasks Do NOT disable tasks *
echo * -s ^| -services Do NOT disable services *
echo * -i ^| -ip Do NOT block IP addresses using route *
echo * -f ^| -firewall Do NOT block IP addresses using firewall *
echo * -h ^| -hosts Do NOT add domains to hosts file *
echo * -u ^| -updates Do NOT change windows update settings *
echo * -l ^| -log Do NOT write messages to .log file *
echo * -e ^| -exit Exit when work is complete *
echo * *
echo * Latest version you can find here: ^<http://goo.gl/1MzPtW^> *
echo * *
echo ***************************************************************************
echo * *
echo * PLEASE DISABLE YOUR ANTIVIRUS SOFTWARE BEFORE^^! *
echo * (Sometimes it block access to hosts file, etc) *
echo * *
echo ***************************************************************************
echo.
rem Setup default script settings + declare variables
set ExitOnComplete=0
set WriteLogFile=1
set UninstallUpdates=1
set DisableUpdates=1
set DisableTasks=1
set DisableServices=1
set BlockIPaddresses=1
set BlockIPaddressesWithFirewall=1
set AddDomainsToHosts=1
set DisableAutomaticUpdates=1
set FirewallIPlist=
set UpdatesList=
set result=
set LogFilePath="%~f0.log"
rem Parse passed arguments to script
:parse_passed_params
if "%~1"=="" goto end_parse_passed_params
if "%~1"=="-e" set ExitOnComplete=1
if "%~1"=="-exit" set ExitOnComplete=1
if "%~1"=="-kb" set UninstallUpdates=0
if "%~1"=="-hotfixes" set UninstallUpdates=0
if "%~1"=="-d" set DisableUpdates=0
if "%~1"=="-disable" set DisableUpdates=0
if "%~1"=="-t" set DisableTasks=0
if "%~1"=="-tasks" set DisableTasks=0
if "%~1"=="-s" set DisableServices=0
if "%~1"=="-services" set DisableServices=0
if "%~1"=="-i" set BlockIPaddresses=0
if "%~1"=="-ip" set BlockIPaddresses=0
if "%~1"=="-f" set BlockIPaddressesWithFirewall=0
if "%~1"=="-firewall" set BlockIPaddressesWithFirewall=0
if "%~1"=="-h" set AddDomainsToHosts=0
if "%~1"=="-hosts" set AddDomainsToHosts=0
if "%~1"=="-u" set DisableAutomaticUpdates=0
if "%~1"=="-updates" set DisableAutomaticUpdates=0
if "%~1"=="-l" set WriteLogFile=0
if "%~1"=="-log" set WriteLogFile=0
shift & goto parse_passed_params
:end_parse_passed_params
goto:checkPermissions
:begin
if %UninstallUpdates%==1 (
call:title "Uninstall evil M$ updates.."
rem You can find KB description here: https://support.microsoft.com/en-us/kb/%KB_NUMBER%
rem 3080149 - Update for customer experience and diagnostic telemetry // 8.1 / WS 2012 R2, 7 SP1 / WS 2008 R2 SP1
rem 3075249 - Update that adds telemetry points to consent.exe in Windows 8.1 and Windows 7 // 8.1 / RT 8.1 / WS 2012 R2 / 7 SP1 / WS 2008 R2 SP1
rem 2952664 - Compatibility update for upgrading Windows 7 // 7 SP1
rem 3035583 - Update installs Get Windows 10 app in Windows 8.1 and Windows 7 SP1 // 8.1 / 7 SP1 / IE11
rem 3068708 - Update for customer experience and diagnostic telemetry // 8.1 / WS 2012 R2 / 7 SP1 / WS 2008 R2 SP1
rem 3022345 - Update for customer experience and diagnostic telemetry // WS 2012 R2 / 8.1 / WS 2008 R2 SP1 / 7 SP1
rem 3021917 - Update to Windows 7 SP1 for performance improvements // 7 SP1
rem 2976978 - Compatibility update for Windows 8.1 and Windows 8 // 8 / 8.1
rem 3044374 - Update that enables you to upgrade from Windows 8.1 to Windows 10 // WS 2012 R2 / 8.1
rem 2990214 - Update that enables you to upgrade from Windows 7 to a later version of Windows // WS 2008 R2 SP1 / 7 SP1
rem 971033 - Update for Windows Activation Technologies // 7
rem 3075851 - Windows Update Client for Windows 7 and Windows Server 2008 R2: August 2015 // WS 2008 R2 SP1 / 7 SP1 / Embedded Standard 7 SP1
rem 3065988 - Windows Update Client for Windows 8.1 and Windows Server 2012 R2: July 2015 more info // WS 2012 R2 / 8.1
rem 3083325 - Windows Update Client for Windows 8.1 and Windows Server 2012 R2: September 2015 more info // WS 2012 R2 / 8.1
rem 3083324 - Windows Update Client for Windows 7 and Windows Server 2008 R2: September 2015 more info // WS 2008 R2 / 7
rem 3075853 - Windows Update Client for Windows 8.1 and Windows Server 2012 R2: August 2015 more info // WS 2012 R2 / 8.1
rem 3065987 - Windows Update Client for Windows 7 and Windows Server 2008 R2: July 2015 more info // WS 2008 R2 / 7
rem 3050265 - Windows Update Client for Windows 7: June 2015 more info // WS 2008 R2 / 7
rem 3050267 - Windows Update Client for Windows 8.1: June 2015 more info // WS 2012 R2 / 8.1
rem 3046480 - Update helps to determine whether to migrate the .NET Framework 1.1 when you upgrade Windows 8.1 or Windows 7 more info // 7 SP1 / 8.1
rem 2882822 - Update adds ITraceRelogger interface support // 7 SP1 / WS 2008 R2
rem 3083710 - Windows Update Client for Windows 7 and Windows Server 2008 R2: October 2015 // 7 SP1 / WS 2008 R2
rem 3083711 - Windows Update Client for Windows 8.1 and Windows Server 2012 R2: October 2015 // 8.1 / WS 2012 R2
rem 3112343 - Windows Update Client for Windows 7 and Windows Server 2008 R2: December 2015 // 7 / WS 2008 R2
rem 3112336 - Windows Update Client for Windows 8.1 and Windows Server 2012 R2: December 2015 // 8.1 / WS 2012 R2
rem 3112336 - Updated capabilities to upgrade Windows 8.1 and Windows 7 // 8.1 / 7 SP1
rem 3112336 - Windows Update Client for Windows 7 and Windows Server 2008 R2: February 2016 // 7 SP1 / WS 2008 R2 / Embedded Standard 7 SP1
for %%? in (
"3080149"
"3075249"
"2952664"
"3035583"
"3068708"
"3022345"
"3021917"
"2976978"
"3044374"
"2990214"
"971033"
"3075851"
"3065988"
"3083325"
"3083324"
"3075853"
"3065987"
"3050265"
"3050267"
"3046480"
"2882822"
"3083710"
"3083711"
"3112343"
"3112336"
"3135445"
"3123862"
) do call:uninstall_update %%?
)
if %DisableUpdates%==1 (
call:title "Disable ^(hide^) uninstalled updates.."
call:log "It can take a lot of time - wait please, or use -d flag for disable this feature.." "Notice"
rem For using this shit you must init updates list by calling 'call:uninstall_update "123123"' first!
call:disable_updates
)
if %DisableTasks%==1 (
call:title "Disable some windows tasks.."
for %%? in (
"\Microsoft\Windows\Application Experience\AitAgent"
"\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
"\Microsoft\Windows\Application Experience\ProgramDataUpdater"
"\Microsoft\Windows\Autochk\Proxy"
"\Microsoft\Windows\Customer Experience Improvement Program\Consolidator"
"\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask"
"\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip"
"\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector"
"\Microsoft\Windows\PI\Sqm-Tasks"
"\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem"
"\Microsoft\Windows\Windows Error Reporting\QueueReporting"
"\Microsoft\Windows\Maintenance\WinSAT"
"\Microsoft\Windows\Media Center\ActivateWindowsSearch"
"\Microsoft\Windows\Media Center\ConfigureInternetTimeService"
"\Microsoft\Windows\Media Center\DispatchRecoveryTasks"
"\Microsoft\Windows\Media Center\ehDRMInit"
"\Microsoft\Windows\Media Center\InstallPlayReady"
"\Microsoft\Windows\Media Center\mcupdate"
"\Microsoft\Windows\Media Center\MediaCenterRecoveryTask"
"\Microsoft\Windows\Media Center\ObjectStoreRecoveryTask"
"\Microsoft\Windows\Media Center\OCURActivate"
"\Microsoft\Windows\Media Center\OCURDiscovery"
"\Microsoft\Windows\Media Center\PBDADiscovery"
"\Microsoft\Windows\Media Center\PBDADiscoveryW1"
"\Microsoft\Windows\Media Center\PBDADiscoveryW2"
"\Microsoft\Windows\Media Center\PvrRecoveryTask"
"\Microsoft\Windows\Media Center\PvrScheduleTask"
"\Microsoft\Windows\Media Center\RegisterSearch"
"\Microsoft\Windows\Media Center\ReindexSearchRoot"
"\Microsoft\Windows\Media Center\SqlLiteRecoveryTask"
"\Microsoft\Windows\Media Center\UpdateRecordPath"
) do call:disable_task %%?
)
if %DisableServices%==1 (
call:title "Disable services.."
for %%? in (
"Diagtrack"
"dmwappushservice"
"WerSvc"
) do call:disable_service %%?
set RegDataCollection="HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection"
reg query !RegDataCollection!>nul 2>&1 & if %errorLevel%==0 (
reg add !RegDataCollection! /v AllowTelemetry /t REG_DWORD /d 0 /f >nul
)
set RegWindowsReporting="HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting"
reg query !RegWindowsReporting!>nul 2>&1 & if %errorLevel%==0 (
reg add !RegWindowsReporting! /v Disabled /t REG_DWORD /d 1 /f >nul
)
)
if %BlockIPaddresses%==1 (
call:title "Block M$ servers IP addresses.."
for %%? in (
"111.221.29.177"
"111.221.29.253"
"131.253.40.37"
"134.170.30.202"
"134.170.115.60"
"134.170.165.248"
"134.170.165.253"
"134.170.185.70"
"137.116.81.24"
"137.117.235.16"
"157.55.129.21"
"157.55.133.204"
"157.56.121.89"
"157.56.91.77"
"168.63.108.233"
"184.86.56.12"
"185.13.160.61"
"191.232.139.254"
"191.232.80.58"
"191.232.80.62"
"191.237.208.126"
"204.79.197.200"
"207.46.101.29"
"207.46.114.58"
"207.46.223.94"
"207.68.166.254"
"212.30.134.204"
"212.30.134.205"
"23.102.21.4"
"23.99.10.11"
"23.218.212.69"
"64.4.54.22"
"64.4.54.32"
"64.4.6.100"
"65.39.117.230"
"65.52.100.11"
"65.52.100.7"
"65.52.100.9"
"65.52.100.91"
"65.52.100.92"
"65.52.100.93"
"65.52.100.94"
"65.52.108.29"
"65.55.108.23"
"65.55.138.114"
"65.55.138.126"
"65.55.138.186"
"65.55.252.63"
"65.55.252.71"
"65.55.252.92"
"65.55.252.93"
"65.55.29.238"
"65.55.39.10"
) do call:block_route %%?
)
if %BlockIPaddressesWithFirewall%==1 (
call:title "Add blocked IP adressess to firewall rule.."
rem For using this shit you must init IP addresses list by calling 'call:block_route "1.1.1.1"' first!
call:block_routes_with_firewall
)
if %AddDomainsToHosts%==1 (
call:title "Find and add M$ domains to HOSTS file ^(block^).."
for %%? in (
"--title--"
"msedge.net"
"a-msedge.net"
"a-0001.a-msedge.net"
"a-0002.a-msedge.net"
"a-0003.a-msedge.net"
"a-0004.a-msedge.net"
"a-0005.a-msedge.net"
"a-0006.a-msedge.net"
"a-0007.a-msedge.net"
"a-0008.a-msedge.net"
"a-0009.a-msedge.net"
"a1095.g2.akamai.net"
"ad.doubleclick.net"
"adnexus.net"
"adnxs.com"
"secure.adnxs.com"
"m.adnxs.com"
"ads1.msads.net"
"ads1.msn.com"
"ads2.msn.com"
"flex.msn.com"
"g.msn.com"
"h2.msn.com"
"h1.msn.com"
"a.ads1.msn.com"
"a.ads2.msn.com"
"a.ads2.msads.net"
"live.rads.msn.com"
"ads2.msn.com.c.footprint.net"
"aka-cdn-ns.adtech.de"
"az361816.vo.msecnd.net"
"az512334.vo.msecnd.net"
"bs.serving-sys.com"
"msntest.serving-sys.com"
"telemetry.microsoft.com"
"ca.telemetry.microsoft.com"
"c.msn.com"
"aidps.atdmt.com"
"view.atdmt.com"
"ec.atdmt.com"
"c.atdmt.com"
"db3aqu.atdmt.com"
"cdn.atdmt.com"
"choice.live.com"
"choice.microsoft.com"
"choice.microsoft.com.nsatc.net"
"compatexchange.cloudapp.net"
"corpext.msitadfs.glbdns2.microsoft.com"
"corp.sts.microsoft.com"
"cs1.wpc.v0cdn.net"
"df.telemetry.microsoft.com"
"e9946.g.akamaiedge.net"
"fe2.update.microsoft.com.akadns.net"
"fe3.delivery.dsp.mp.microsoft.com.nsatc.net"
"microsoft-hohm.com"
"feedback.microsoft-hohm.com"
"feedback.search.microsoft.com"
"feedback.windows.com"
"i1.services.social.microsoft.com"
"i1.services.social.microsoft.com.nsatc.net"
"i.s1.social.ms.akadns.net"
"lb1.www.ms.akadns.net"
"legacy-redirection-neurope-prod-hp.cloudapp.net"
"oca.telemetry.microsoft.com"
"oca.telemetry.microsoft.com.nsatc.net"
"onesettings-hk2.metron.live.com.nsatc.net"
"pre.footprintpredict.com"
"preview.msn.com"
"ads.msn.com"
"rad.msn.com"
"rad.live.com"
"b.rad.msn.com"
"b.ads2.msads.net"
"b.ads1.msn.com"
"ac3.msn.com"
"a.rad.msn.com"
"cds26.ams9.msecn.net"
"secure.flashtalking.com"
"static.2mdn.net"
"s0.2mdn.net"
"redirection.prod.cms.msn.com"
"redirection.prod.cms.msn.com.akadns.net"
"redir.metaservices.microsoft.com"
"redir.metaservices.microsoft.com.akadns.net"
"redir.metaservices.microsoft.com.edgesuite.net"
"wes.df.telemetry.microsoft.com"
"reports.wes.df.telemetry.microsoft.com"
"services.wes.df.telemetry.microsoft.com"
"settings.data.glbdns2.microsoft.com"
"settings.data.microsoft.com"
"settings-sandbox.data.glbdns2.microsoft.com"
"settings-sandbox.data.microsoft.com"
"settings-win.data.microsoft.com"
"schemas.microsoft.akadns.net"
"siweb.microsoft.akadns.net"
"sls.update.microsoft.com.akadns.net"
"spynet2.microsoft.akadns.net"
"spynet2.microsoft.com"
"spynetalt.microsoft.akadns.net"
"spynetalt.microsoft.com"
"spyneteurope.microsoft.akadns.net"
"sqm.df.telemetry.microsoft.com"
"sqm.telemetry.microsoft.com"
"sqm.telemetry.microsoft.com.nsatc.net"
"ssw.live.com"
"ssw.live.com.nsatc.net"
"statsfe1.ws.microsoft.com"
"statsfe1.ws.microsoft.com.nsatc.net"
"statsfe2.update.microsoft.com.akadns.net"
"statsfe2.ws.microsoft.com"
"statsfe2.ws.microsoft.com.nsatc.net"
"support.msn.microsoft.akadns.net"
"watson.microsoft.com"
"survey.watson.microsoft.com"
"telecommand.telemetry.microsoft.com"
"telecommand.telemetry.microsoft.com.nsatc.net"
"telemetry.appex.bing.net"
"telemetry.appex.search.prod.ms.akadns.net"
"telemetry.urs.microsoft.com"
"t.urs.microsoft.com.nsatc.net"
"vortex.data.glbdns2.microsoft.com"
"vortex.data.metron.live.com.nsatc.net"
"vortex-bn2.metron.live.com.nsatc.net"
"vortex-cy2.metron.live.com.nsatc.net"
"vortex.data.microsoft.com"
"vortex-db5.metron.live.com.nsatc.net"
"vortex-sandbox.data.glbdns2.microsoft.com"
"vortex-sandbox.data.microsoft.com"
"vortex-win.data.metron.live.com.nsatc.net"
"vortex-win.data.microsoft.com"
"watson.live.com"
"watson.microsoft.com.nsatc.net"
"watson.ppe.telemetry.microsoft.com"
"watson.telemetry.microsoft.com"
"watson.telemetry.microsoft.com.nsatc.net"
) do call:add_to_hosts %%?
)
if %DisableAutomaticUpdates%==1 (
call:title "Disable automatic windows update ^(make search, but you must manually select updates to install^)"
set RegeditRoot="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update"
reg add !RegeditRoot! /v AUOptions /t REG_DWORD /d 2 /f>nul
reg add !RegeditRoot! /v IncludeRecommendedUpdates /t REG_DWORD /d 0 /f>nul
)
goto:end
:log
set message=%~1
set type=%~2
if [!type!] EQU [] (
set type=%time%
)
echo [!type!] %message%
if %WriteLogFile%==1 ( if [%LogFilePath%] NEQ [] (
echo [!type!] %message%>>%LogFilePath% 2>&1
))
exit /b
:title
set title=%~1
echo.
echo [i] %title%
if %WriteLogFile%==1 ( if [%LogFilePath%] NEQ [] (
echo.>>%LogFilePath% 2>&1
echo [i] %title%>>%LogFilePath% 2>&1
))
exit /b
:checkPermissions
if exist %SystemRoot%\System32\fsutil.exe (
fsutil dirty query %systemdrive%>nul 2>&1
) else (
net session >nul 2>&1
)
if %errorLevel%==0 (
goto:begin
) else (
call:log "[Failure] Need administrative permissions"
goto:end
)
exit /b
:download_file
set url=%~1
set dest=%~2
powershell -ExecutionPolicy RemoteSigned -NoLogo -Noninteractive -Command "try { Import-Module BitsTransfer; Start-BitsTransfer -Source %url% -Destination %dest%; exit 100; } catch { exit 0; }">nul
exit /b
:install_pswu_module
set ps_modules_dir=%windir%\System32\WindowsPowerShell\v1.0\Modules
set pswu_distr_path="!ps_modules_dir!\PSWindowsUpdate"
set result=0
if exist "!pswu_distr_path!\Hide-WUUpdate.ps1" (
rem call:log "PowerShell module 'PSWindowsUpdate' found"
set result=100
) else (
set local_unzip_tool=0
set local_pswu_module=0
call:log "Install PowerShell module 'PSWindowsUpdate'" "Install update"
if exist "%~dp0\unzip.exe" (
set local_unzip_tool=1
set unzip_tool="%~dp0\unzip.exe"
call:log "Local unzip tool found"
) else (
set unzip_tool="%temp%\unzip.exe"
call:log "Download unzip tool.."
rem Original source: http://stahlworks.com/dev/unzip.exe
call:download_file "https://www.dropbox.com/s/gxf8d4bg0yyozdh/unzip.exe?dl=1" !unzip_tool!
)
if exist !unzip_tool! (
if exist "%~dp0\PSWindowsUpdate.zip" (
set local_pswu_module=1
set pswu_zip="%~dp0\PSWindowsUpdate.zip"
call:log "Local PSWindowsUpdate module found"
) else (
set pswu_zip="%temp%\PSWindowsUpdate.zip"
call:log "Download PowerShell module 'PSWindowsUpdate'.."
rem Original source: https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc/
call:download_file "https://www.dropbox.com/s/z61nlkfecmhabil/PSWindowsUpdate.zip?dl=1" !pswu_zip!
)
if exist !pswu_zip! (
set pswu_temp="%temp%\pswindowsupdate_content"
call:log "Unzip module archive.."
!unzip_tool! -oC !pswu_zip! -d !pswu_temp!>nul
if exist !pswu_temp! (
call:log "Move module files to PowerShell modules directory.."
if exist !pswu_distr_path! (rmdir !pswu_distr_path! /s /q>nul)
move /y "!pswu_temp!\PSWindowsUpdate" !ps_modules_dir!>nul
if "!local_unzip_tool!" NEQ "1" (del /f !unzip_tool!>nul)
if "!local_pswu_module!" NEQ "1" (del /f !pswu_zip!>nul)
rmdir !pswu_temp! /s /q>nul
if exist "!pswu_distr_path!\Hide-WUUpdate.ps1" (
call:log "'PSWindowsUpdate' module for PowerShell installed" "Installation complete"
set result=100
timeout /t 2 /nobreak>nul & tskill powershell>nul 2>&1 & timeout /t 2 /nobreak>nul
) else (
call:log "Installation module 'PSWindowsUpdate' failed - files in !pswu_distr_path! not found" "Installation failed"
)
)
)
)
)
exit /b
:uninstall_update
set kb_id=%~1
rem Remove update
call:log "Uninstall update KB%kb_id%.."
start /wait wusa /uninstall /norestart /quiet /kb:%kb_id%
if %errorlevel%==2359303 call:log "Update KB%kb_id% not installed"
if %errorlevel%==1223 call:log "Uninstall cancelled"
if %errorlevel%==3010 call:log "Update KB%kb_id% UNINSTALLED successfully"
rem Add all updates IDs to single string variable (',' is delimiter)
set UpdatesList=%UpdatesList%KB%kb_id%,
exit /b
:disable_updates
rem Add update to Windows Update exceptions (hide update) using PowerShell
if [!UpdatesList!] EQU [] (
call:log "Empty updates list. For add update ID to block list - uninstall update by script before" "Error"
exit /b
)
rem Remove last (',') char
set UpdatesListForDisabling=!UpdatesList:~0,-1!
call:install_pswu_module
if %result%==100 (
call:log "Disable updates: !UpdatesListForDisabling!.."
powershell -ExecutionPolicy RemoteSigned -NoLogo -Noninteractive -Command "Import-Module PSWindowsUpdate; try { Hide-WUUpdate -KBArticleID !UpdatesListForDisabling! -Confirm:$false; exit 100; } catch { exit 0; }">nul 2>&1
if !errorlevel!==100 (
call:log "Updates successfully DISABLED"
) else (
call:log "Cannot disable updates: Update your PowerShell or install PowerShell module 'PSWindowsUpdate'" "Error"
)
)
exit /b
:block_route
set REDIRECT=0.0.0.0
set ip_addr=%~1
call:log "Block route to %ip_addr%"
route -p ADD %ip_addr% MASK 255.255.255.255 %REDIRECT%>nul 2>&1
rem Add all addresses to single string variable (',' is delimiter)
set FirewallIPlist=%FirewallIPlist%%ip_addr%,
exit /b
:block_routes_with_firewall
if [!FirewallIPlist!] EQU [] (
call:log "Empty IP list. For add IP to firewall block list - block ip by route first" "Error"
exit /b
)
if exist %SystemRoot%\System32\netsh.exe (
set FirewallRuleName=Block MS Telemetry
rem Remove exists rule + add new rule + make exists check
netsh advfirewall firewall delete rule name="!FirewallRuleName!">nul
netsh advfirewall firewall add rule name="!FirewallRuleName!" dir=out action=block remoteip=!FirewallIPlist! interfacetype=any>nul
netsh advfirewall firewall show rule name="!FirewallRuleName!">nul
if %errorlevel% EQU 0 (
call:log "IP adresses blocked with firewall rule '!FirewallRuleName!': '!FirewallIPlist:~0,-1!'"
) else (
call:log "Cannot add firewall rule '!FirewallRuleName!' - maybe firewall servise disabled^?" "Error"
)
) else (
call:log "Windows firewall not accessible (file 'netsh.exe' not exists)" "Error"
)
exit /b
:disable_task
set task_name=%~1
call:log "Disable task %task_name%"
schtasks /Change /TN "%task_name%" /DISABLE>nul 2>&1
exit /b
:disable_service
set service_name=%~1
set errors_counter=0
call:log "Disable service '%service_name%'"
sc query "%service_name%">nul
if %errorlevel% NEQ 1060 (
sc config "!service_name!" start= disabled>nul
if %errorlevel% NEQ 0 set /a errors_counter=errors_counter+1
sc stop "!service_name!">nul
if %errorlevel% NEQ 0 set /a errors_counter=errors_counter+1
if %errors_counter%==0 (
call:log "Service '!service_name!' disabled successful"
)
) else set /a errors_counter=errors_counter+1 & call:log "Service '!service_name!' not installed"
exit /b
:add_to_hosts
set HOSTS=%SystemRoot%\system32\drivers\etc\hosts
set REDIRECT=0.0.0.0
set block_title=## Block MS telemetry domain names
set write_title=0
set host_name=%~1
if "%host_name%"=="--title--" (
set write_title=1
set host_name=%block_title%
)
find /C /I "%host_name%" %HOSTS%>nul
if %errorlevel% NEQ 0 (
attrib -r %HOSTS%>nul
if !write_title! EQU 1 (
echo.>>%HOSTS%
echo.>>%HOSTS%
echo %block_title%>>%HOSTS%
) else (
echo %REDIRECT% %host_name%>>%HOSTS%
call:log "Domain %host_name% ADDED"
)
) else (
if !write_title! NEQ 1 (
call:log "Domain %host_name% ALREADY added"
)
)
exit /b
:end
call:title "Exit after 60 seconds, or press any key for exit now"
timeout /t 60>nul 2>&1
endlocal & if %ExitOnComplete%==1 (exit)
echo on
@Fr0sT-Brutal

This comment has been minimized.

Copy link

Fr0sT-Brutal commented Aug 24, 2015

Change "exit /b" to "goto :EOF", this won't force close terminal window if script is executed from command line rather than explorer.

@tarampampam

This comment has been minimized.

Copy link
Owner Author

tarampampam commented Aug 24, 2015

exit /b is exit from "function", not from script, so it can't be changed

@Grandbrother

This comment has been minimized.

Copy link

Grandbrother commented Aug 26, 2015

Perhaps it is well worth adding:
sc config remoteregistry start= disabled
sc stop remoteregistry

@tarampampam

This comment has been minimized.

Copy link
Owner Author

tarampampam commented Aug 27, 2015

No, f*ck, no, you dont need disable remote registry

@thunderpants

This comment has been minimized.

Copy link

thunderpants commented Aug 27, 2015

2 questions :
What if i'm using Eset I.S ?
I think the win firewall is switched off in win 7 x64.
and
what are the forks about ?
There is 7 forks of this ,do they do something different/worthwhile ?

@AvgurD

This comment has been minimized.

Copy link

AvgurD commented Aug 28, 2015

Script fails on Windows 7 Home Basic with PowerShell 1.0 installed (no module PSWindowsUpdate).
Please add info about the module installation:

  1. download zip from https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc
  2. extract to %WINDIR%\System32\WindowsPowerShell\v1.0\Modules
@powerman

This comment has been minimized.

Copy link

powerman commented Aug 28, 2015

@AvgurD Thanks! Same issue on Win7 Ultimate SP1 (I've installed it into user's home dir instead).

@tarampampam

This comment has been minimized.

Copy link
Owner Author

tarampampam commented Aug 30, 2015

To @thunderpants:
Maybe script will work without errors - you can discover this only after testing :)
And about forks - i don't found any interesting changes

@tarampampam

This comment has been minimized.

Copy link
Owner Author

tarampampam commented Aug 30, 2015

To @AvgurD:
Yep, i added this feature. You can test now

@tarampampam

This comment has been minimized.

Copy link
Owner Author

tarampampam commented Aug 30, 2015

To @powerman:
Can you show me log with your issues?

@MarvinFS

This comment has been minimized.

Copy link

MarvinFS commented Sep 4, 2015

Привет ковырялся с 10-ткой дополнительно список потенциально опасных тасков, конечно нужно посмотреть, но имхо полезного от них точно ничего:

echo Step 4: Disabling MarvinFS tasks...
schtasks /Change /TN "\Microsoft\Office\Office 15 Subscription Heartbeat" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\AppID\EDP Policy Manager" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\AppID\SmartScreenSpecific" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\CloudExperienceHost\CreateObjectTask" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\Diagnosis\Scheduled" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\DiskFootprint\Diagnostics" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\Feedback\Siuf\DmClient" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\Location\Notifications" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\Location\WindowsActionDialog" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\Maps\MapsToastTask" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\Maps\MapsUpdateTask" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\Mobile Broadband Accounts\MNO Metadata Parser" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\NetCfg\BindingWorkItemQueueHandler" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\NetTrace\GatherNetworkInfo" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\PI\Secure-Boot-Update" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\PI\Sqm-Tasks" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\RemoteAssistance\RemoteAssistanceTask" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\RemovalTools\MRT_HB" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\SettingSync\NetworkStateChangeTask" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\Shell\CreateObjectTask" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\SkyDrive\Idle Sync Maintenance Task" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\SkyDrive\Routine Maintenance Task" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\WCM\WiFiTask" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\WDI\ResolutionHost" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\Windows Error Reporting\QueueReporting" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\Windows Media Sharing\UpdateLibrary" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\WS\Badge Update" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\WS\Sync Licenses" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\WS\WSRefreshBannedAppsListTask" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\WS\WSTask" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\TPM\Tpm-HASCertRetr" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\TPM\Tpm-Maintenance" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\WindowsUpdate\sih" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\WindowsUpdate\sihboot" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\WOF\WIM-Hash-Management" /DISABLE
schtasks /Change /TN "\Microsoft\Windows\WOF\WIM-Hash-Validation" /DISABLE

rem also some changes here - i'm thinking that making it from a script is a more convenient way: 
rem setacl's are for granting rights for BackgroundUploadTask

C:\Windows\System32\setaclx64 -on "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks" -ot reg -actn setowner -ownr "n:Administrators" -rec yes
C:\Windows\System32\setaclx64 -on "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks" -ot reg -actn ace -ace "n:Administrators;p:full" -rec yes
C:\Windows\System32\setaclx64 -on "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{18E3AD12-4E0A-4293-AE32-2B1F14BF8C9C}" -ot reg -actn setowner -ownr "n:Administrators" -rec yes
C:\Windows\System32\setaclx64 -on "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\c\Tasks\{18E3AD12-4E0A-4293-AE32-2B1F14BF8C9C}" -ot reg -actn ace -ace "n:Administrators;p:full" -rec yes

rem changing triggers section for being able to disable the task 
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{18E3AD12-4E0A-4293-AE32-2B1F14BF8C9C}" /v Triggers /t REG_SZ /d "17,00,00,00,00,00,00,00,00,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,\ff,ff,ff,00,ff,ff,ff,ff,ff,ff,ff,00,00,00,00,00,00,00,00,4a,85,00,42,48,48,\48,48,5c,9a,5f,7b,48,48,48,48,0c,00,00,00,48,48,48,48,55,00,73,00,65,00,72,\00,73,00,00,00,48,48,48,48,00,00,00,00,48,48,48,48,00,48,48,48,48,48,48,48,\00,48,48,48,48,48,48,48,05,00,00,00,48,48,48,48,0c,00,00,00,48,48,48,48,01,\01,00,00,00,00,00,05,04,00,00,00,48,48,48,48,00,00,00,00,48,48,48,48,58,00,\00,00,48,48,48,48,00,00,00,00,30,2a,00,00,80,f4,03,00,ff,ff,ff,ff,07,00,00,\00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,\00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,00,00,00,00" /f

schtasks /Change /TN "\Microsoft\Windows\SettingSync\BackgroundUploadTask" /DISABLE

echo CHECK ON ERRORS here on "\Microsoft\Windows\SettingSync\BackgroundUploadTask" /DISABLE it must be disabled!
pause

крайний таск BackgroundUploadTask что называется на буржуйском tricky - нужно сначала дать с помощью setacl права на ветки реестра, потом поменять в ветке triggers значение (там два байта) и потом уже заблокировать таск... можно еще с помощью psexec запустить сразу от имени system и заблокировать - этот вариант не пробовал но люди говорят что работает

@pdi77-2

This comment has been minimized.

Copy link

pdi77-2 commented Sep 4, 2015

Приветствую, оказывается сайт diagnostics.support.microsoft.com используется для загрузки утилит FixIt, наверное нужно его убрать из списка хостов для блокировки.
Хотя возможно это не так, через раз выдает ошибку при загрузке. Сообщу дополнительно позже.
P.S. Ну вот сообщаю что действительно при наличии сайта в хостах, загрузка утилит не идет.
Можете проверить сами http://go.microsoft.com/?linkid=9775982, после запуска MicrosoftFixit-portable.exe выйдет ошибка.

@pdi77-2

This comment has been minimized.

Copy link

pdi77-2 commented Sep 17, 2015

Приветствую. Увидел новую версию скрипта, а почему не обратили внимание на мой комментарий по поводу сайта diagnostics.support.microsoft.com?

@tarampampam

This comment has been minimized.

Copy link
Owner Author

tarampampam commented Sep 18, 2015

To @pdi77-2:
Не всегда проверяю здесь комментарии. Основное обсуждение завязалось в блоге. Хост из списка был удален, спасибо!

@yura-p

This comment has been minimized.

Copy link

yura-p commented Dec 6, 2015

Приветствую, похоже в блоге комментарии более не поддерживаются :-)
Прошу обратить внимание на домен *.msftncsi.com - он используется для проверки доступности интернет, и в случае недоступности этого домена, винда рисует желтый значок на сетевом адаптере в трее.
https://technet.microsoft.com/en-us/library/cc766017%28WS.10%29.aspx
с уважением...

@simdol

This comment has been minimized.

Copy link

simdol commented Dec 6, 2015

You should include latest new recommended update of https://support.microsoft.com/en-us/kb/3112336 'KB3112336' to the list of removal from the upgrade.

"This update enables support for additional upgrade scenarios from Windows 8.1 to Windows 10, and provides a smoother experience when you have to retry an operating system upgrade because of certain failure conditions. This update also improves the ability of Microsoft to monitor the quality of the upgrade experience."

@rootk1t

This comment has been minimized.

Copy link

rootk1t commented Dec 27, 2015

Приветствую!

К комменту выше, хочу добавить.

KB3112343 - https://support.microsoft.com/en-us/kb/3112343 - Windows Update Client for Windows 7 and Windows Server 2008 R2: December 2015
Неплохо бы его внести в очередной релиз программы.

@ghost

This comment has been minimized.

Copy link

ghost commented Jan 22, 2016

"apps.skype.com"
"ui.skype.com"
"s.gateway.messenger.live.com"

Из-за блокировки этих хостов - в конференциях скайпа не показываются участники и вообще они начинают сильно глючить.

@simdol

This comment has been minimized.

Copy link

simdol commented Jan 31, 2016

Thanks for your last update. MS has added few new updates that you should add them to the blacklist.

  • https://support.microsoft.com/en-us/kb/2976978
    "This update performs diagnostics on the Windows systems that participate in the Windows Customer Experience Improvement Program. These diagnostics help determine whether compatibility issues may be encountered when the latest Windows operating system is installed. This update will help Microsoft and its partners ensure compatibility for customers who want to install the latest Windows operating system."
  • https://support.microsoft.com/en-us/kb/3035583
    "This update installs the Get Windows 10 app, which helps users understand their Windows 10 upgrade options and device readiness. For more information about Windows 10, see Windows 10.

This update applies to Windows 8.1 or Windows 7 Service Pack 1 (SP1). Before you install this update, check out the Prerequisites section."

@kickdev

This comment has been minimized.

Copy link

kickdev commented Feb 5, 2016

Точнее вот:
0.0.0.0 ui.skype.com
0.0.0.0 pricelist.skype.com
0.0.0.0 apps.skype.com
0.0.0.0 m.hotmail.com
0.0.0.0 s.gateway.messenger.live.com

@pim76

This comment has been minimized.

Copy link

pim76 commented Feb 10, 2016

-KB2952664-v16 02.02.16 Обновление для Windows 7 (для перехода на Windows 10)
-KB3135445 02.02.16 Windows Update Client for Windows 7 (для перехода на Windows 10)
-KB3123862 03.02.16 Обновление для Windows 7 (для перехода на Windows 10)
http://forum.ru-board.com/topic.cgi?forum=62&topic=24100&start=4011&limit=1&m=1#1

@tarampampam

This comment has been minimized.

Copy link
Owner Author

tarampampam commented Feb 16, 2016

2 @yura-p - msftncsi.com у нас совсем не используется, но всё же - спасибо!
2 @PekaFat - Спасибо за информацию! Данные доменные имена были убраны из блокировки
2 @simdol - Updates 3068708, 3035583 and 2976978 already added to the script. In any case, thank you!
2 @kickdev - Спасибо, убрал и их!
2 @pim76 - Спасибо за информацию, обновления были добавлены в скрипт!

@Fr0sT-Brutal

This comment has been minimized.

Copy link

Fr0sT-Brutal commented Mar 10, 2016

KB3139929 тоже гадость, причем пополам с полезностью :(
https://habrahabr.ru/post/278933/

@simdol

This comment has been minimized.

Copy link

simdol commented Mar 11, 2016

Oddly enough, this script still does not disable optional updates for KB2976978, KB3035583, and KB3068708. For me, this is what made by confused me on the last comment. I cannot reproduce this issue, however, it seems that only those three are appearing on the Windows Update after running your script and restarting the computer.

I will update this as soon as I find out the cause. By the way, for some odd reasons, the KB3035583 and KB3068708 has changed or updated the release date, something to keep in mind.

@brenoritvrezorkre

This comment has been minimized.

Copy link

brenoritvrezorkre commented May 24, 2016

Добавьте 3133977, он ломает материнки:
https://xakep.ru/2016/05/10/kb3133977/

@simdol

This comment has been minimized.

Copy link

simdol commented Jun 15, 2016

Please blacklist latest telemetry update: KB2976978 (Compatibility update for Windows 8.1 and Windows 8).

Thank you,

https://support.microsoft.com/en-us/kb/2976978

@hardhub

This comment has been minimized.

Copy link

hardhub commented Jun 23, 2016

what is about this one?

https://support.microsoft.com/en-us/kb/3161608

It contains: KB3161647 Windows Update Client for Windows 7 and Windows Server 2008 R2: June 2016

@mrniko

This comment has been minimized.

Copy link

mrniko commented Jun 26, 2016

Ребят, спасибо за то что вы тут делаете

@mrniko

This comment has been minimized.

Copy link

mrniko commented Jun 27, 2016

Office 2016 telemetry block:

netsh advfirewall firewall delete rule name="Winword.EXE_BLOCK"
netsh advfirewall firewall add rule name="Winword.EXE_BLOCK" dir=out interface=any action=block program="%ProgramFiles%\Microsoft Office\Office16\WINWORD.EXE"

netsh advfirewall firewall delete rule name="POWERPNT.EXE_BLOCK"
netsh advfirewall firewall add rule name="POWERPNT.EXE_BLOCK" dir=out interface=any action=block program="%ProgramFiles%\Microsoft Office\Office16\POWERPNT.EXE"

netsh advfirewall firewall delete rule name="EXCEL.EXE_BLOCK"
netsh advfirewall firewall add rule name="EXCEL.EXE_BLOCK" dir=out interface=any action=block program="%ProgramFiles%\Microsoft Office\Office16\EXCEL.EXE"

netsh advfirewall firewall delete rule name="MSOSYNC.EXE_BLOCK"
netsh advfirewall firewall add rule name="MSOSYNC.EXE_BLOCK" dir=out interface=any action=block program="%ProgramFiles%\Microsoft Office\Office16\MSOSYNC.EXE"
@tarampampam

This comment has been minimized.

Copy link
Owner Author

tarampampam commented Jun 29, 2016

Скрипт мной более не поддерживается. Обновлений ждать нет смысла. Всем мур

The script is longer supported. Updates will not be. Meow, blyat

@simdol

This comment has been minimized.

Copy link

simdol commented Jul 14, 2016

I've added new updates to the script, and fixed some typos here and there. I intend to support this script further on behalf of tarampampam. https://github.com/simdol/Remove-MS-Telemetry-and-Annoyances

@tarampampam: Thanks for your script and continued support until now. Your script has been excellent solution for many users here, and I would like to thank everyone else who contributed to this script as well.

@rusboss

This comment has been minimized.

Copy link

rusboss commented Dec 15, 2016

Здравия, Благодарю за скрипт. Подскажите пожалуйста, как бороться с проблемой загрузки рабочего стола после авторизации пользователя. Метод смены пользователя на вновь созданного не помогает, а система все дольше открывает рабочий стол после авторизации видового юзера, просто смысл SSD диска пропадает под систему. Появляется мышь на черном экране и так приходится ждать минуту или две, пока откликнутся первые проблески explorer. Благодарю!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.