Advertisement
aveyo

windows_10_bloat_subscribe_toggle

Mar 26th, 2018
8,343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 8.17 KB | None | 0 0
  1. @echo off& title Windows 10 Bloat Subscribe Toggle
  2. :: AveYo: added complete SubscribedContent reference
  3. call :check_status
  4. echo(
  5. echo      ---------------------------------------------------------------------
  6. echo     :            Windows 10 Bloat Subscribe Toggle v2019.10.28            :
  7. echo     :---------------------------------------------------------------------:
  8. echo     :  Only a prevention, won't uninstall existing items for your account :
  9. echo     :  But new users get a clean LTSC-like menu with no 3rd party items.  :
  10. echo     :       Usually prevents bloat being reinstalled after upgrades       :
  11. echo     :              Run this script again to subscribe on/off              :
  12. echo     :                                                                     :
  13. echo     :                       Before: %STATUS%%__%                          :
  14. echo     :                                                                     :
  15. echo     : Press Alt+F4 to cancel                    Always run latest version :
  16. echo      ---------------------------------------------------------------------
  17. echo                                                         RED = unsubscribed
  18. timeout /t 3 >nul
  19. :: ask for elevation passing args and preventing loop
  20. set "args="%~f0" %*"& reg query HKU\S-1-5-19>nul 2>nul || if "%_%" neq "y" (
  21. powershell -c "$Env:_='y';$ErrorActionPreference=0;start cmd -Arg \"/c call $Env:args\" -verb runas"& exit)
  22.  
  23. :: Main
  24. set "OP=add"& set "DEL="& set "D0=0x0"& set "D1=0x1"
  25. if "%STATUS%"=="UNSUBSCRIBED" set "OP=delete"& set "DEL=&rem"& set "D0=0x0"& set "D1=0x1"
  26.  
  27. :: HKCU entries will also be propagated to new users:
  28. reg load HKU\NewUsers "C:\Users\Default\NTUSER.DAT" >nul && set "NewUsers=HKU\NewUsers" || set "NewUsers="
  29.  
  30. :: Manage Content Delivery (SubscribedContent) Bloat
  31. set "cdm=Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
  32. for %%u in (HKCU %NewUsers%) do (
  33.  reg %OP% "%%u\%CDM%" /f /v FeatureManagementEnabled %DEL% /d 0 /t reg_dword                  %= Feature Management generic     =%
  34.  reg %OP% "%%u\%CDM%" /f /v ContentDeliveryAllowed %DEL% /d 0 /t reg_dword                    %= Content Delivery generic       =%
  35.  reg %OP% "%%u\%CDM%" /f /v OemPreInstalledAppsEnabled %DEL% /d 0 /t reg_dword                %= OEM Preinstalled Apps          =%
  36.  reg %OP% "%%u\%CDM%" /f /v PreInstalledAppsEnabled %DEL% /d 0 /t reg_dword                   %= Preinstalled Apps              =%
  37.  reg %OP% "%%u\%CDM%" /f /v PreInstalledAppsEverEnabled %DEL% /d 0 /t reg_dword               %= Preinstalled Apps flag         =%
  38.  reg %OP% "%%u\%CDM%" /f /v RotatingLockScreenEnabled %DEL% /d 0 /t reg_dword                 %= Lock Screen Ads                =%
  39.  reg %OP% "%%u\%CDM%" /f /v RotatingLockScreenOverlayEnabled %DEL% /d 0 /t reg_dword          %= Lock Screen Tips               =%
  40.  reg %OP% "%%u\%CDM%" /f /v SilentInstalledAppsEnabled %DEL% /d 0 /t reg_dword                %= Suggested Apps                 =%
  41.  reg %OP% "%%u\%CDM%" /f /v SoftLandingEnabled %DEL% /d 0 /t reg_dword                        %= Tips about Windows             =%
  42.  reg %OP% "%%u\%CDM%" /f /v SubscribedContentEnabled %DEL% /d 0 /t reg_dword                  %= Suggested Apps generic         =%
  43.  reg %OP% "%%u\%CDM%" /f /v SystemPaneSuggestionsEnabled %DEL% /d 0 /t reg_dword              %= Settings Suggestions           =%
  44.  
  45.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-202913Enabled %DEL% /d 0 /t reg_dword           %= SilentInstalledApps 1          =%
  46.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-202914Enabled %DEL% /d 0 /t reg_dword           %= SilentInstalledApps 2          =%
  47.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-280797Enabled %DEL% /d 0 /t reg_dword           %= SyncProviders 1 OneDriveLocal  =%
  48.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-280811Enabled %DEL% /d 0 /t reg_dword           %= SyncProviders 2 OneDriveLocal  =%
  49.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-280812Enabled %DEL% /d 0 /t reg_dword           %= ApiTest                        =%
  50.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-280813Enabled %DEL% /d 0 /t reg_dword           %= Windows Ink - StokedOnIt       =%
  51.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-280814Enabled %DEL% /d 0 /t reg_dword           %= Share 1 Facebook Instagram     =%
  52.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-280815Enabled %DEL% /d 0 /t reg_dword           %= Share 2 Facebook Instagram     =%
  53.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-280810Enabled %DEL% /d 0 /t reg_dword           %= OneDriveSync 1                 =%
  54.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-280817Enabled %DEL% /d 0 /t reg_dword           %= OneDriveSync 2                 =%
  55.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-310091Enabled %DEL% /d 0 /t reg_dword           %= ActionCenter 1                 =%
  56.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-310092Enabled %DEL% /d 0 /t reg_dword           %= ActionCenter 2                 =%
  57.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-310093Enabled %DEL% /d 0 /t reg_dword           %= MinuteZeroOffers 1             =%
  58.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-310094Enabled %DEL% /d 0 /t reg_dword           %= MinuteZeroOffers 2             =%
  59.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-314558Enabled %DEL% /d 0 /t reg_dword           %= DynamicLayouts 1 Candy Crush   =%
  60.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-314559Enabled %DEL% /d 0 /t reg_dword           %= DynamicLayouts 2 Candy Crush   =%
  61.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-314562Enabled %DEL% /d 0 /t reg_dword           %= PeopleAppSuggestions 1         =%
  62.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-314563Enabled %DEL% /d 0 /t reg_dword           %= PeopleAppSuggestions 2         =%
  63.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-314566Enabled %DEL% /d 0 /t reg_dword           %= OobeOffers 1                   =%
  64.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-314567Enabled %DEL% /d 0 /t reg_dword           %= OobeOffers 2                   =%
  65.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-338380Enabled %DEL% /d 0 /t reg_dword           %= LockScreen 1 Hotspot           =%
  66.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-338387Enabled %DEL% /d 0 /t reg_dword           %= LockScreen 2 Hotspot           =%
  67.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-338381Enabled %DEL% /d 0 /t reg_dword           %= StartSuggestions 1             =%
  68.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-338388Enabled %DEL% /d 0 /t reg_dword           %= StartSuggestions 2             =%
  69.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-338382Enabled %DEL% /d 0 /t reg_dword           %= WindowsTip 1                   =%
  70.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-338389Enabled %DEL% /d 0 /t reg_dword           %= WindowsTip 2                   =%
  71.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-338386Enabled %DEL% /d 0 /t reg_dword           %= Settings 1                     =%
  72.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-338393Enabled %DEL% /d 0 /t reg_dword           %= Settings 2                     =%
  73.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-346480Enabled %DEL% /d 0 /t reg_dword           %= Signals 1                      =%
  74.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-346481Enabled %DEL% /d 0 /t reg_dword           %= Signals 2                      =%
  75.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-353694Enabled %DEL% /d 0 /t reg_dword           %= SettingsAccountsYourInfo 1     =%
  76.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-353695Enabled %DEL% /d 0 /t reg_dword           %= SettingsAccountsYourInfo 2     =%
  77.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-353696Enabled %DEL% /d 0 /t reg_dword           %= SettingsHome 1                 =%
  78.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-353697Enabled %DEL% /d 0 /t reg_dword           %= SettingsHome 2                 =%
  79.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-353698Enabled %DEL% /d 0 /t reg_dword           %= Timeline 1                     =%
  80.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-353699Enabled %DEL% /d 0 /t reg_dword           %= Timeline 2                     =%
  81.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-88000044Enabled %DEL% /d 0 /t reg_dword         %= AppDefaultsEdgeEnlightenment 1 =%
  82.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-88000045Enabled %DEL% /d 0 /t reg_dword         %= AppDefaultsEdgeEnlightenment 2 =%
  83.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-88000105Enabled %DEL% /d 0 /t reg_dword         %= SettingsValueBanner 1          =%
  84.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-88000106Enabled %DEL% /d 0 /t reg_dword         %= SettingsValueBanner 2          =%
  85.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-88000161Enabled %DEL% /d 0 /t reg_dword         %= OneDriveDocuments 1            =%
  86.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-88000162Enabled %DEL% /d 0 /t reg_dword         %= OneDriveDocuments 2            =%
  87.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-88000163Enabled %DEL% /d 0 /t reg_dword         %= OneDriveDesktop 1              =%
  88.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-88000164Enabled %DEL% /d 0 /t reg_dword         %= OneDriveDesktop 2              =%
  89.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-88000165Enabled %DEL% /d 0 /t reg_dword         %= OneDrivePictures 1             =%
  90.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-88000166Enabled %DEL% /d 0 /t reg_dword         %= OneDrivePictures 2             =%
  91. ) >nul 2>nul
  92. :: Discover other subscriptions and add them too
  93. for %%u in (HKCU %NewUsers%) do for /f %%s in ('reg query "HKCU\%CDM%\Subscriptions"') do (
  94.  reg %OP% "%%u\%CDM%" /f /v SubscribedContent-%%~nxsEnabled %DEL% /d 0 /t reg_dword
  95. ) >nul 2>nul
  96. :: Discover suggested apps
  97. for %%u in (HKCU %NewUsers%) do for /f %%s in ('reg query "HKCU\%CDM%\SuggestedApps" 2^>nul ^|find "REG_D" 2^>nul') do (
  98.  reg %OP% "%%u\%CDM%\SuggestedApps" /f /v %%s %DEL% /d 0 /t reg_dword
  99. ) >nul 2>nul
  100. :: Manage background run for ContentDelivery
  101. rem set "backgracc=Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications"
  102. rem for %%u in (HKCU %NewUsers%) do (
  103. rem reg %OP% "%%u\%backgracc%\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy" /f /v Disabled %DEL% /d 1 /t reg_dword
  104. rem ) >nul 2>nul
  105. :: Manage Windows Ink suggestions
  106. set "INK=Software\Microsoft\Windows\CurrentVersion\PenWorkspace"
  107. for %%u in (HKCU %NewUsers%) do (
  108.  reg %OP% "%%u\%INK%" /f /v PenWorkspaceAppSuggestionsEnabled %DEL% /d 0 /t reg_dword
  109. ) >nul 2>nul
  110. :: Manage Sync Providers (OneDrive) notifications
  111. set "SYNC=Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
  112. for %%u in (HKCU %NewUsers%) do (
  113.  reg %OP% "%%u\%SYNC%" /f /v ShowSyncProviderNotifications %DEL% /d 0 /t reg_dword
  114. ) >nul 2>nul
  115. :: Done!
  116.  
  117. :: HKCU entries will also be propagated to new users:
  118. reg unload HKU\NewUsers >nul
  119.  
  120. call :check_status
  121. echo(
  122. echo --------------------------
  123. echo  After : %STATUS%
  124. echo --------------------------
  125. echo(
  126. pause
  127. exit/b
  128.  
  129. :check_status
  130. set "bloatkey=HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
  131. for /f "tokens=2*" %%s in ('reg query "%bloatkey%" /v ContentDeliveryAllowed 2^>nul') do set "BLOAT_SUBSCRIBE=%%t"
  132. if "%BLOAT_SUBSCRIBE%"=="" (set "STATUS=   DEFAULT  "& color 0b) else set "STATUS=UNSUBSCRIBED"& color 0c
  133. set "__="& exit/b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement