Advertisement
Guest User

Untitled

a guest
Apr 6th, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.50 KB | None | 0 0
  1. @ECHO OFF
  2. ECHO.
  3. ECHO. This batch must be run as Admin
  4. ECHO.
  5. ECHO. Privacy and/or bandwidth conscious tweaks for
  6. ECHO. Windows 10 (also OK to run on Win 7, 8, 8.1)
  7. ECHO.
  8. PAUSE
  9.  
  10. IF NOT EXIST "C:\Windows\System32\GWX" goto skipgwx
  11. ECHO.
  12. ECHO. **************************************************************************************
  13. ECHO. Prevent auto upgrade to Win10
  14. ECHO. **************************************************************************************
  15. ECHO.
  16.  
  17. TAKEOWN /f "C:\Windows\System32\Tasks\Microsoft\Windows\SettingSync" /a /r /d Y
  18. ECHO y| CACLS "C:\Windows\System32\Tasks\Microsoft\Windows\SettingSync" /T /C /G BUILTIN\Administrators:F "NT AUTHORITY\LOCAL SERVICE":F "NT AUTHORITY\SYSTEM":F
  19. TAKEOWN /f "C:\Windows\System32\Tasks\Microsoft\Windows\Setup\GWXTriggers" /a /r /d Y
  20. ECHO y| CACLS "C:\Windows\System32\Tasks\Microsoft\Windows\Setup\GWXTriggers" /T /C /G BUILTIN\Administrators:F "NT AUTHORITY\LOCAL SERVICE":F "NT AUTHORITY\SYSTEM":F
  21. TAKEOWN /f "C:\Windows\System32\Tasks\Microsoft\Windows\Shell" /a /r /d Y
  22. ECHO y| CACLS "C:\Windows\System32\Tasks\Microsoft\Windows\Shell" /T /C /G BUILTIN\Administrators:F "NT AUTHORITY\LOCAL SERVICE":F "NT AUTHORITY\SYSTEM":F
  23. RENAME "C:\Windows\System32\GWX" GWX-disabled
  24. PAUSE
  25. :skipgwx
  26.  
  27. ECHO.
  28. ECHO. **************************************************************************************
  29. ECHO. Stop and remove services not required
  30. ECHO. **************************************************************************************
  31. ECHO.
  32. REM for some HP machines
  33. sc config HPAuto start= disabled
  34. sc config hpqwmiex start= disabled
  35. sc config "HP Health Check Service" start= disabled
  36. sc config "HP Support Assistant Service" start= disabled
  37.  
  38. REM for Intel management/spyware that is not needed
  39. sc config "Intel(R) Capability Licensing Service Interface" start= disabled
  40. sc config cphs start= disabled
  41. sc config jhi_service start= disabled
  42. sc config LMS start= disabled
  43. sc config UNS start= disabled
  44.  
  45. REM for Windows 10 below...
  46. sc config WinDefend start= disabled
  47. REM sc config seclogon start= disabled
  48. sc config RetailDemo start= disabled
  49.  
  50. sc stop DiagTrack
  51. sc stop diagnosticshub.standardcollector.service
  52. sc stop dmwappushservice
  53. sc stop WMPNetworkSvc
  54. sc stop WSearch
  55.  
  56. sc config DiagTrack start= disabled
  57. sc config diagnosticshub.standardcollector.service start= disabled
  58. sc config dmwappushservice start= disabled
  59. sc config WMPNetworkSvc start= disabled
  60. sc config WSearch start= disabled
  61.  
  62. echo "" > C:\ProgramData\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl
  63. PAUSE
  64.  
  65. ECHO.
  66. ECHO. **************************************************************************************
  67. ECHO. Remove Scheduled tasks problems
  68. ECHO. **************************************************************************************
  69. ECHO.
  70. schtasks /Change /TN "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /Disable
  71. schtasks /Change /TN "Microsoft\Windows\Application Experience\ProgramDataUpdater" /Disable
  72. schtasks /Change /TN "Microsoft\Windows\Application Experience\StartupAppTask" /Disable
  73. schtasks /Change /TN "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /Disable
  74. schtasks /Change /TN "Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /Disable
  75. schtasks /Change /TN "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /Disable
  76. schtasks /Change /TN "Microsoft\Windows\Customer Experience Improvement Program\Uploader" /Disable
  77. schtasks /Change /TN "Microsoft\Windows\Shell\FamilySafetyUpload" /Disable
  78. schtasks /Change /TN "Microsoft\Office\OfficeTelemetryAgentLogOn" /Disable
  79. schtasks /Change /TN "Microsoft\Office\OfficeTelemetryAgentFallBack" /Disable
  80. schtasks /Change /TN "Microsoft\Office\Office 15 Subscription Heartbeat" /Disable
  81. schtasks /Change /TN "Microsoft\Windows\CloudExperienceHost\CreateObjectTask" /Disable
  82. schtasks /Change /TN "Microsoft\Windows\DiskFootprint\Diagnostics" /Disable *** Not sure if should be disabled, maybe related to S.M.A.R.T.
  83. schtasks /Change /TN "Microsoft\Windows\FileHistory\File History (maintenance mode)" /Disable
  84. schtasks /Change /TN "Microsoft\Windows\PI\Sqm-Tasks" /Disable
  85. schtasks /Change /TN "Microsoft\Windows\Windows Error Reporting\QueueReporting" /Disable
  86. schtasks /Change /TN "Microsoft\Windows\WindowsUpdate\Automatic App Update" /Disable
  87. PAUSE
  88.  
  89.  
  90. ECHO.
  91. ECHO. **************************************************************************************
  92. ECHO. Reg Edits for problems
  93. ECHO. **************************************************************************************
  94. ECHO.
  95.  
  96. ECHO. WiFi Sense, HotSpot Sharing, Disable
  97. reg add "HKLM\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" /v value /t REG_DWORD /d 0 /f
  98. ECHO. WiFi Sense, Shared HotSpot Auto-Connect, Disable
  99. reg add "HKLM\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" /v value /t REG_DWORD /d 0 /f
  100.  
  101. ECHO. Disable your machine from sending updates to other machines
  102. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" /v DownloadMode /t REG_DWORD /d 0 /f
  103.  
  104. ECHO. Change Windows Update to Notify to schedule restart
  105. reg add "HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" /v UxOption /t REG_DWORD /d 1 /f
  106.  
  107. ECHO. Hide the search box from taskbar
  108. REM 0 = hide completely, 1 = show only icon, 2 = show long search box
  109. reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f
  110.  
  111. ECHO. Disable MRU lists (jump lists) of XAML apps in Start Menu
  112. reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_TrackDocs" /t REG_DWORD /d 0 /f
  113.  
  114. ECHO. Set Windows Explorer to start on This PC instead of Quick Access
  115. REM 1 = This PC, 2 = Quick access
  116. reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "LaunchTo" /t REG_DWORD /d 1 /f
  117.  
  118. ECHO. Show hidden files in Explorer
  119. reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Hidden" /t REG_DWORD /d 1 /f
  120.  
  121. ECHO. Show super hidden system files in Explorer
  122. reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowSuperHidden" /t REG_DWORD /d 1 /f
  123.  
  124. ECHO. Show file extensions in Explorer
  125. reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f
  126.  
  127. ECHO. Remove other Telemetry & Data Collection...
  128. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" /v PreventDeviceMetadataFromNetwork /t REG_DWORD /d 1 /f
  129. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
  130. reg add "HKLM\SOFTWARE\Policies\Microsoft\MRT" /v DontOfferThroughWUAU /t REG_DWORD /d 1 /f
  131. reg add "HKLM\SOFTWARE\Policies\Microsoft\SQMClient\Windows" /v "CEIPEnable" /t REG_DWORD /d 0 /f
  132. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "AITEnable" /t REG_DWORD /d 0 /f
  133. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "DisableUAR" /t REG_DWORD /d 1 /f
  134. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
  135. reg add "HKLM\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener" /v "Start" /t REG_DWORD /d 0 /f
  136. reg add "HKLM\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\SQMLogger" /v "Start" /t REG_DWORD /d 0 /f
  137. PAUSE
  138.  
  139. ECHO.
  140. ECHO. **************************************************************************************
  141. ECHO. Disable and uninstall OneDrive
  142. ECHO. **************************************************************************************
  143. ECHO.
  144.  
  145. REM BEGIN uninstall OneDrive
  146. set x86="%SYSTEMROOT%\System32\OneDriveSetup.exe"
  147. set x64="%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe"
  148.  
  149. echo Closing OneDrive process.
  150. echo.
  151. taskkill /f /im OneDrive.exe > NUL 2>&1
  152. ping 127.0.0.1 -n 5 > NUL 2>&1
  153.  
  154. echo Uninstalling OneDrive.
  155. echo.
  156. if exist %x64% (
  157. %x64% /uninstall
  158. ) else (
  159. %x86% /uninstall
  160. )
  161. ping 127.0.0.1 -n 5 > NUL 2>&1
  162.  
  163. echo Removing OneDrive leftovers.
  164. echo.
  165. rd "%USERPROFILE%\OneDrive" /Q /S > NUL 2>&1
  166. rd "C:\OneDriveTemp" /Q /S > NUL 2>&1
  167. rd "%LOCALAPPDATA%\Microsoft\OneDrive" /Q /S > NUL 2>&1
  168. rd "%PROGRAMDATA%\Microsoft OneDrive" /Q /S > NUL 2>&1
  169.  
  170. ECHO. Remove OneDrive from the Explorer Side Panel
  171. REG DELETE "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
  172. REG DELETE "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
  173. PAUSE
  174.  
  175. ECHO.
  176. ECHO. **************************************************************************************
  177. ECHO. Uninstall Win10 apps
  178. ECHO. **************************************************************************************
  179. ECHO.
  180. PowerShell -Command "Get-AppxPackage *3DBuilder* | Remove-AppxPackage"
  181. PowerShell -Command "Get-AppxPackage *Getstarted* | Remove-AppxPackage"
  182. PowerShell -Command "Get-AppxPackage *WindowsAlarms* | Remove-AppxPackage"
  183. PowerShell -Command "Get-AppxPackage *WindowsCamera* | Remove-AppxPackage"
  184. PowerShell -Command "Get-AppxPackage *bing* | Remove-AppxPackage"
  185. PowerShell -Command "Get-AppxPackage *MicrosoftOfficeHub* | Remove-AppxPackage"
  186. PowerShell -Command "Get-AppxPackage *OneNote* | Remove-AppxPackage"
  187. PowerShell -Command "Get-AppxPackage *people* | Remove-AppxPackage"
  188. PowerShell -Command "Get-AppxPackage *WindowsPhone* | Remove-AppxPackage"
  189. PowerShell -Command "Get-AppxPackage *photos* | Remove-AppxPackage"
  190. PowerShell -Command "Get-AppxPackage *SkypeApp* | Remove-AppxPackage"
  191. PowerShell -Command "Get-AppxPackage *solit* | Remove-AppxPackage"
  192. PowerShell -Command "Get-AppxPackage *WindowsSoundRecorder* | Remove-AppxPackage"
  193. PowerShell -Command "Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage"
  194. PowerShell -Command "Get-AppxPackage *zune* | Remove-AppxPackage"
  195. PowerShell -Command "Get-AppxPackage *WindowsCalculator* | Remove-AppxPackage"
  196. PowerShell -Command "Get-AppxPackage *WindowsMaps* | Remove-AppxPackage"
  197. PowerShell -Command "Get-AppxPackage *Sway* | Remove-AppxPackage"
  198. PowerShell -Command "Get-AppxPackage *CommsPhone* | Remove-AppxPackage"
  199. PowerShell -Command "Get-AppxPackage *ConnectivityStore* | Remove-AppxPackage"
  200. PowerShell -Command "Get-AppxPackage *Microsoft.Messaging* | Remove-AppxPackage"
  201. PowerShell -Command "Get-AppxPackage *Facebook* | Remove-AppxPackage"
  202. PowerShell -Command "Get-AppxPackage *Twitter* | Remove-AppxPackage"
  203. PowerShell -Command "Get-AppxPackage *Drawboard PDF* | Remove-AppxPackage"
  204. PAUSE
  205.  
  206. ECHO.
  207. ECHO. **************************************************************************************
  208. ECHO. Uninstall Win7/8/10 Telemetry stuff
  209. ECHO. **************************************************************************************
  210. ECHO.
  211. wusa /uninstall /KB:2952664 /norestart /quiet
  212. wusa /uninstall /KB:2990214 /norestart /quiet
  213. wusa /uninstall /KB:3021917 /norestart /quiet
  214. wusa /uninstall /KB:3022345 /norestart /quiet
  215. wusa /uninstall /KB:3035583 /norestart /quiet
  216. wusa /uninstall /KB:3044374 /norestart /quiet
  217. wusa /uninstall /KB:3068708 /norestart /quiet
  218. wusa /uninstall /KB:3075249 /norestart /quiet
  219. wusa /uninstall /KB:3080149 /norestart /quiet
  220. wusa /uninstall /KB:2977759 /norestart /quiet
  221. PAUSE
  222.  
  223. :notice
  224. ECHO.
  225. ECHO. **************************************************************************************
  226. ECHO. All done...
  227. ECHO. A restart is required for all changes to take effect!
  228. ECHO. **************************************************************************************
  229. ECHO.
  230. PAUSE
  231.  
  232. :done
  233. EXIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement