Guest User

Untitled

a guest
Feb 16th, 2021
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 83.51 KB | None | 0 0
  1. @echo off
  2. :: https://privacy.sexy — v0.9.1 — Fri, 05 Feb 2021 21:05:49 GMT
  3. :: Ensure admin privileges
  4. fltmc >nul 2>&1 || (
  5. echo Administrator privileges are required.
  6. PowerShell Start -Verb RunAs '%0' 2> nul || (
  7. echo Right-click on the script and select "Run as administrator".
  8. pause & exit 1
  9. )
  10. exit 0
  11. )
  12.  
  13.  
  14. :: ----------------------------------------------------------
  15. :: ------------Delete controversial default0 user------------
  16. :: ----------------------------------------------------------
  17. echo --- Delete controversial default0 user
  18. net user defaultuser0 /delete 2>nul
  19. :: ----------------------------------------------------------
  20.  
  21.  
  22. :: ----------------------------------------------------------
  23. :: --------Enable Reset Base in Dism Component Store---------
  24. :: ----------------------------------------------------------
  25. echo --- Enable Reset Base in Dism Component Store
  26. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\SideBySide\Configuration" /v "DisableResetbase" /t "REG_DWORD" /d "0" /f
  27. :: ----------------------------------------------------------
  28.  
  29.  
  30. :: ----------------------------------------------------------
  31. :: -------------Disable cloud speech recognition-------------
  32. :: ----------------------------------------------------------
  33. echo --- Disable cloud speech recognition
  34. reg add "HKCU\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy" /v "HasAccepted" /t "REG_DWORD" /d 0 /f
  35. :: ----------------------------------------------------------
  36.  
  37.  
  38. :: ----------------------------------------------------------
  39. :: -----------Opt out from Windows privacy consent-----------
  40. :: ----------------------------------------------------------
  41. echo --- Opt out from Windows privacy consent
  42. reg add "HKCU\SOFTWARE\Microsoft\Personalization\Settings" /v "AcceptedPrivacyPolicy" /t REG_DWORD /d 0 /f
  43. :: ----------------------------------------------------------
  44.  
  45.  
  46. :: ----------------------------------------------------------
  47. :: -----------------Disable Windows feedback-----------------
  48. :: ----------------------------------------------------------
  49. echo --- Disable Windows feedback
  50. reg add "HKCU\SOFTWARE\Microsoft\Siuf\Rules" /v "NumberOfSIUFInPeriod" /t REG_DWORD /d 0 /f
  51. reg delete "HKCU\SOFTWARE\Microsoft\Siuf\Rules" /v "PeriodInNanoSeconds" /f
  52. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "DoNotShowFeedbackNotifications" /t REG_DWORD /d 1 /f
  53. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "DoNotShowFeedbackNotifications" /t REG_DWORD /d 1 /f
  54. :: ----------------------------------------------------------
  55.  
  56.  
  57. :: ----------------------------------------------------------
  58. :: ---------Disable text and handwriting collection----------
  59. :: ----------------------------------------------------------
  60. echo --- Disable text and handwriting collection
  61. reg add "HKCU\Software\Policies\Microsoft\InputPersonalization" /v "RestrictImplicitInkCollection" /t REG_DWORD /d 1 /f
  62. reg add "HKLM\SOFTWARE\Policies\Microsoft\InputPersonalization" /v "RestrictImplicitInkCollection" /t REG_DWORD /d 1 /f
  63. reg add "HKCU\Software\Policies\Microsoft\InputPersonalization" /v "RestrictImplicitTextCollection" /t REG_DWORD /d 1 /f
  64. reg add "HKLM\SOFTWARE\Policies\Microsoft\InputPersonalization" /v "RestrictImplicitTextCollection" /t REG_DWORD /d 1 /f
  65. reg add "HKCU\Software\Policies\Microsoft\Windows\HandwritingErrorReports" /v "PreventHandwritingErrorReports" /t REG_DWORD /d 1 /f
  66. reg add "HKLM\Software\Policies\Microsoft\Windows\HandwritingErrorReports" /v "PreventHandwritingErrorReports" /t REG_DWORD /d 1 /f
  67. reg add "HKCU\Software\Policies\Microsoft\Windows\TabletPC" /v "PreventHandwritingDataSharing" /t REG_DWORD /d 1 /f
  68. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\TabletPC" /v "PreventHandwritingDataSharing" /t REG_DWORD /d 1 /f
  69. reg add "HKLM\SOFTWARE\Policies\Microsoft\InputPersonalization" /v "AllowInputPersonalization" /t REG_DWORD /d 0 /f
  70. reg add "HKCU\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" /v "HarvestContacts" /t REG_DWORD /d 0 /f
  71. :: ----------------------------------------------------------
  72.  
  73.  
  74. :: ----------------------------------------------------------
  75. :: -------------------Disable Wi-Fi sense--------------------
  76. :: ----------------------------------------------------------
  77. echo --- Disable Wi-Fi sense
  78. reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" /v "value" /t REG_DWORD /d 0 /f
  79. reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" /v "value" /t REG_DWORD /d 0 /f
  80. reg add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" /v "AutoConnectAllowedOEM" /t REG_DWORD /d 0 /f
  81. :: ----------------------------------------------------------
  82.  
  83.  
  84. :: ----------------------------------------------------------
  85. :: ---------------Disable Inventory Collector----------------
  86. :: ----------------------------------------------------------
  87. echo --- Disable Inventory Collector
  88. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "DisableInventory" /t REG_DWORD /d 1 /f
  89. :: ----------------------------------------------------------
  90.  
  91.  
  92. :: ----------------------------------------------------------
  93. :: ---------Disable Website Access of Language List----------
  94. :: ----------------------------------------------------------
  95. echo --- Disable Website Access of Language List
  96. reg add "HKCU\Control Panel\International\User Profile" /v "HttpAcceptLanguageOptOut" /t REG_DWORD /d 1 /f
  97. :: ----------------------------------------------------------
  98.  
  99.  
  100. :: ----------------------------------------------------------
  101. :: --------------Disable Auto Downloading Maps---------------
  102. :: ----------------------------------------------------------
  103. echo --- Disable Auto Downloading Maps
  104. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Maps" /v "AllowUntriggeredNetworkTrafficOnSettingsPage" /t REG_DWORD /d 0 /f
  105. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Maps" /v "AutoDownloadAndUpdateMapData" /t REG_DWORD /d 0 /f
  106. :: ----------------------------------------------------------
  107.  
  108.  
  109. :: ----------------------------------------------------------
  110. :: ------------------Disable steps recorder------------------
  111. :: ----------------------------------------------------------
  112. echo --- Disable steps recorder
  113. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "DisableUAR" /t REG_DWORD /d 1 /f
  114. :: ----------------------------------------------------------
  115.  
  116.  
  117. :: ----------------------------------------------------------
  118. :: -----Disable feedback on write (sending typing info)------
  119. :: ----------------------------------------------------------
  120. echo --- Disable feedback on write (sending typing info)
  121. reg add "HKLM\SOFTWARE\Microsoft\Input\TIPC" /v "Enabled" /t REG_DWORD /d 0 /f
  122. reg add "HKCU\SOFTWARE\Microsoft\Input\TIPC" /v "Enabled" /t REG_DWORD /d 0 /f
  123. :: ----------------------------------------------------------
  124.  
  125.  
  126. :: ----------------------------------------------------------
  127. :: ------------------Disable Activity Feed-------------------
  128. :: ----------------------------------------------------------
  129. echo --- Disable Activity Feed
  130. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "EnableActivityFeed" /d "0" /t REG_DWORD /f
  131. :: ----------------------------------------------------------
  132.  
  133.  
  134. :: ----------------------------------------------------------
  135. :: ----Disable Customer Experience Improvement (CEIP/SQM)----
  136. :: ----------------------------------------------------------
  137. echo --- Disable Customer Experience Improvement (CEIP/SQM)
  138. reg add "HKLM\Software\Policies\Microsoft\SQMClient\Windows" /v "CEIPEnable" /t REG_DWORD /d "0" /f
  139. :: ----------------------------------------------------------
  140.  
  141.  
  142. :: ----------------------------------------------------------
  143. :: --------Disable Application Impact Telemetry (AIT)--------
  144. :: ----------------------------------------------------------
  145. echo --- Disable Application Impact Telemetry (AIT)
  146. reg add "HKLM\Software\Policies\Microsoft\Windows\AppCompat" /v "AITEnable" /t REG_DWORD /d "0" /f
  147. :: ----------------------------------------------------------
  148.  
  149.  
  150. :: ----------------------------------------------------------
  151. :: --------------Disable diagnostics telemetry---------------
  152. :: ----------------------------------------------------------
  153. echo --- Disable diagnostics telemetry
  154. reg add "HKLM\SYSTEM\ControlSet001\Services\DiagTrack" /v "Start" /t REG_DWORD /d 4 /f
  155. reg add "HKLM\SYSTEM\ControlSet001\Services\dmwappushsvc" /v "Start" /t REG_DWORD /d 4 /f
  156. reg add "HKLM\SYSTEM\CurrentControlSet\Services\dmwappushservice" /v "Start" /t REG_DWORD /d 4 /f
  157. reg add "HKLM\SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service" /v "Start" /t REG_DWORD /d 4 /f
  158. sc stop "DiagTrack" & sc config "DiagTrack" start=disabled
  159. sc stop "dmwappushservice" & sc config "dmwappushservice" start=disabled
  160. sc stop "diagnosticshub.standardcollector.service" & sc config "diagnosticshub.standardcollector.service" start=disabled
  161. sc stop "diagsvc" & sc config "diagsvc" start=disabled
  162. :: ----------------------------------------------------------
  163.  
  164.  
  165. :: ----------------------------------------------------------
  166. :: -----Disable Customer Experience Improvement Program------
  167. :: ----------------------------------------------------------
  168. echo --- Disable Customer Experience Improvement Program
  169. schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /DISABLE
  170. schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /DISABLE
  171. schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /DISABLE
  172. :: ----------------------------------------------------------
  173.  
  174.  
  175. :: ----------------------------------------------------------
  176. :: -------Disable Webcam Telemetry (devicecensus.exe)--------
  177. :: ----------------------------------------------------------
  178. echo --- Disable Webcam Telemetry (devicecensus.exe)
  179. schtasks /change /TN "Microsoft\Windows\Device Information\Device" /DISABLE
  180. :: ----------------------------------------------------------
  181.  
  182.  
  183. :: ----------------------------------------------------------
  184. :: -Disable Application Experience (Compatibility Telemetry)-
  185. :: ----------------------------------------------------------
  186. echo --- Disable Application Experience (Compatibility Telemetry)
  187. schtasks /change /TN "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE
  188. schtasks /change /TN "Microsoft\Windows\Application Experience\ProgramDataUpdater" /DISABLE
  189. schtasks /change /TN "Microsoft\Windows\Application Experience\StartupAppTask" /DISABLE
  190. schtasks /change /TN "Microsoft\Windows\Application Experience\AitAgent" /DISABLE
  191. reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CompatTelRunner.exe" /v "Debugger" /t REG_SZ /d "%windir%\System32\taskkill.exe" /f
  192. :: ----------------------------------------------------------
  193.  
  194.  
  195. :: ----------------------------------------------------------
  196. :: -------Disable telemetry in data collection policy--------
  197. :: ----------------------------------------------------------
  198. echo --- Disable telemetry in data collection policy
  199. reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /d 0 /t REG_DWORD /f
  200. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
  201. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
  202. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "LimitEnhancedDiagnosticDataWindowsAnalytics" /t REG_DWORD /d 0 /f
  203. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
  204. :: ----------------------------------------------------------
  205.  
  206.  
  207. :: ----------------------------------------------------------
  208. :: ----------------Disable license telemetry-----------------
  209. :: ----------------------------------------------------------
  210. echo --- Disable license telemetry
  211. reg add "HKLM\Software\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v "NoGenTicket" /t "REG_DWORD" /d "1" /f
  212. :: ----------------------------------------------------------
  213.  
  214.  
  215. :: ----------------------------------------------------------
  216. :: -----------------Disable error reporting------------------
  217. :: ----------------------------------------------------------
  218. echo --- Disable error reporting
  219. :: Disable Windows Error Reporting (WER)
  220. reg add "HKLM\Software\Policies\Microsoft\Windows\Windows Error Reporting" /v "Disabled" /t REG_DWORD /d "1" /f
  221. reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v "Disabled" /t "REG_DWORD" /d "1" /f
  222. :: DefaultConsent / 1 - Always ask (default) / 2 - Parameters only / 3 - Parameters and safe data / 4 - All data
  223. reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\Consent" /v "DefaultConsent" /t REG_DWORD /d "0" /f
  224. reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\Consent" /v "DefaultOverrideBehavior" /t REG_DWORD /d "1" /f
  225. :: Disable WER sending second-level data
  226. reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting" /v "DontSendAdditionalData" /t REG_DWORD /d "1" /f
  227. :: Disable WER crash dialogs, popups
  228. reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting" /v "LoggingDisabled" /t REG_DWORD /d "1" /f
  229. schtasks /Change /TN "Microsoft\Windows\ErrorDetails\EnableErrorDetailsUpdate" /Disable
  230. schtasks /Change /TN "Microsoft\Windows\Windows Error Reporting\QueueReporting" /Disable
  231. :: Disable Windows Error Reporting Service
  232. sc stop "WerSvc" & sc config "WerSvc" start=disabled
  233. sc stop "wercplsupport" & sc config "wercplsupport" start=disabled
  234. :: ----------------------------------------------------------
  235.  
  236.  
  237. :: ----------------------------------------------------------
  238. :: -------Disable ad customization with Advertising ID-------
  239. :: ----------------------------------------------------------
  240. echo --- Disable ad customization with Advertising ID
  241. reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d 0 /f
  242. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" /v "DisabledByGroupPolicy" /t REG_DWORD /d 1 /f
  243. :: ----------------------------------------------------------
  244.  
  245.  
  246. :: ----------------------------------------------------------
  247. :: ------------------Disable targeted tips-------------------
  248. :: ----------------------------------------------------------
  249. echo --- Disable targeted tips
  250. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableSoftLanding" /t REG_DWORD /d 1 /f
  251. reg add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsSpotlightFeatures" /t "REG_DWORD" /d "1" /f
  252. reg add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t "REG_DWORD" /d "1" /f
  253. :: ----------------------------------------------------------
  254.  
  255.  
  256. :: ----------------------------------------------------------
  257. :: --------Turn Off Suggested Content in Settings app--------
  258. :: ----------------------------------------------------------
  259. echo --- Turn Off Suggested Content in Settings app
  260. reg add HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-338393Enabled" /d "0" /t REG_DWORD /f
  261. reg add HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-353694Enabled" /d "0" /t REG_DWORD /f
  262. reg add HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-353696Enabled" /d "0" /t REG_DWORD /f
  263. :: ----------------------------------------------------------
  264.  
  265.  
  266. :: ----------------------------------------------------------
  267. :: -------------Disable Windows Insider Service--------------
  268. :: ----------------------------------------------------------
  269. echo --- Disable Windows Insider Service
  270. sc stop "wisvc" & sc config "wisvc" start=disabled
  271. :: ----------------------------------------------------------
  272.  
  273.  
  274. :: ----------------------------------------------------------
  275. :: -----Do not let Microsoft try features on this build------
  276. :: ----------------------------------------------------------
  277. echo --- Do not let Microsoft try features on this build
  278. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "EnableExperimentation" /t REG_DWORD /d 0 /f
  279. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "EnableConfigFlighting" /t REG_DWORD /d 0 /f
  280. reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\System\AllowExperimentation" /v "value" /t "REG_DWORD" /d 0 /f
  281. :: ----------------------------------------------------------
  282.  
  283.  
  284. :: ----------------------------------------------------------
  285. :: --------Disable getting preview builds of Windows---------
  286. :: ----------------------------------------------------------
  287. echo --- Disable getting preview builds of Windows
  288. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "AllowBuildPreview" /t REG_DWORD /d 0 /f
  289. :: ----------------------------------------------------------
  290.  
  291.  
  292. :: ----------------------------------------------------------
  293. :: --------------Disable NET Core CLI telemetry--------------
  294. :: ----------------------------------------------------------
  295. echo --- Disable NET Core CLI telemetry
  296. setx DOTNET_CLI_TELEMETRY_OPTOUT 1
  297. :: ----------------------------------------------------------
  298.  
  299.  
  300. :: ----------------------------------------------------------
  301. :: -------------Disable PowerShell 7+ telemetry--------------
  302. :: ----------------------------------------------------------
  303. echo --- Disable PowerShell 7+ telemetry
  304. setx POWERSHELL_TELEMETRY_OPTOUT 1
  305. :: ----------------------------------------------------------
  306.  
  307.  
  308. :: ----------------------------------------------------------
  309. :: -------------Disable visual studio telemetry--------------
  310. :: ----------------------------------------------------------
  311. echo --- Disable visual studio telemetry
  312. reg add "HKCU\Software\Microsoft\VisualStudio\Telemetry" /v "TurnOffSwitch" /t REG_DWORD /d 1 /f
  313. :: ----------------------------------------------------------
  314.  
  315.  
  316. :: ----------------------------------------------------------
  317. :: --------------Disable Visual Studio feedback--------------
  318. :: ----------------------------------------------------------
  319. echo --- Disable Visual Studio feedback
  320. reg add "HKLM\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback" /v "DisableFeedbackDialog" /t REG_DWORD /d 1 /f
  321. reg add "HKLM\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback" /v "DisableEmailInput" /t REG_DWORD /d 1 /f
  322. reg add "HKLM\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback" /v "DisableScreenshotCapture" /t REG_DWORD /d 1 /f
  323. :: ----------------------------------------------------------
  324.  
  325.  
  326. :: ----------------------------------------------------------
  327. :: Stop and disable Visual Studio Standard Collector Service-
  328. :: ----------------------------------------------------------
  329. echo --- Stop and disable Visual Studio Standard Collector Service
  330. sc stop "VSStandardCollectorService150" & sc config "VSStandardCollectorService150" start=disabled
  331. :: ----------------------------------------------------------
  332.  
  333.  
  334. :: ----------------------------------------------------------
  335. :: --------------------Disable SQM OS key--------------------
  336. :: ----------------------------------------------------------
  337. echo --- Disable SQM OS key
  338. if %PROCESSOR_ARCHITECTURE%==x86 ( REM is 32 bit?
  339. reg add "HKLM\SOFTWARE\Microsoft\VSCommon\14.0\SQM" /v "OptIn" /t REG_DWORD /d 0 /f
  340. reg add "HKLM\SOFTWARE\Microsoft\VSCommon\15.0\SQM" /v "OptIn" /t REG_DWORD /d 0 /f
  341. reg add "HKLM\SOFTWARE\Microsoft\VSCommon\16.0\SQM" /v "OptIn" /t REG_DWORD /d 0 /f
  342. ) else (
  343. reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\VSCommon\14.0\SQM" /v "OptIn" /t REG_DWORD /d 0 /f
  344. reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\VSCommon\15.0\SQM" /v "OptIn" /t REG_DWORD /d 0 /f
  345. reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\VSCommon\16.0\SQM" /v "OptIn" /t REG_DWORD /d 0 /f
  346. )
  347. :: ----------------------------------------------------------
  348.  
  349.  
  350. :: ----------------------------------------------------------
  351. :: -----------------Disable SQM group policy-----------------
  352. :: ----------------------------------------------------------
  353. echo --- Disable SQM group policy
  354. reg add "HKLM\Software\Policies\Microsoft\VisualStudio\SQM" /v "OptIn" /t REG_DWORD /d 0 /f
  355. :: ----------------------------------------------------------
  356.  
  357.  
  358. :: ----------------------------------------------------------
  359. :: ----------------Do not send Watson events-----------------
  360. :: ----------------------------------------------------------
  361. echo --- Do not send Watson events
  362. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting" /v "DisableGenericReports" /t REG_DWORD /d 1 /f
  363. :: ----------------------------------------------------------
  364.  
  365.  
  366. :: ----------------------------------------------------------
  367. :: Disable Malicious Software Reporting tool diagnostic data-
  368. :: ----------------------------------------------------------
  369. echo --- Disable Malicious Software Reporting tool diagnostic data
  370. reg add "HKLM\SOFTWARE\Policies\Microsoft\MRT" /v "DontReportInfectionInformation" /t REG_DWORD /d 1 /f
  371. :: ----------------------------------------------------------
  372.  
  373.  
  374. :: Disable local setting override for reporting to Microsoft MAPS
  375. echo --- Disable local setting override for reporting to Microsoft MAPS
  376. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" /v "LocalSettingOverrideSpynetReporting" /t REG_DWORD /d 0 /f
  377. :: ----------------------------------------------------------
  378.  
  379.  
  380. :: ----------------------------------------------------------
  381. :: --------Turn off Windows Defender SpyNet reporting--------
  382. :: ----------------------------------------------------------
  383. echo --- Turn off Windows Defender SpyNet reporting
  384. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" /v "SpynetReporting" /t REG_DWORD /d 0 /f
  385. :: ----------------------------------------------------------
  386.  
  387.  
  388. :: ----------------------------------------------------------
  389. :: ------Do not send file samples for further analysis-------
  390. :: ----------------------------------------------------------
  391. echo --- Do not send file samples for further analysis
  392. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" /v "SubmitSamplesConsent" /t REG_DWORD /d 2 /f
  393. :: ----------------------------------------------------------
  394.  
  395.  
  396. :: ----------------------------------------------------------
  397. :: -------------Uninstall NVIDIA telemetry tasks-------------
  398. :: ----------------------------------------------------------
  399. echo --- Uninstall NVIDIA telemetry tasks
  400. if exist "%ProgramFiles%\NVIDIA Corporation\Installer2\InstallerCore\NVI2.DLL" (
  401. rundll32 "%PROGRAMFILES%\NVIDIA Corporation\Installer2\InstallerCore\NVI2.DLL",UninstallPackage NvTelemetryContainer
  402. rundll32 "%PROGRAMFILES%\NVIDIA Corporation\Installer2\InstallerCore\NVI2.DLL",UninstallPackage NvTelemetry
  403. )
  404. :: ----------------------------------------------------------
  405.  
  406.  
  407. :: ----------------------------------------------------------
  408. :: ----------Delete NVIDIA residual telemetry files----------
  409. :: ----------------------------------------------------------
  410. echo --- Delete NVIDIA residual telemetry files
  411. del /s %SystemRoot%\System32\DriverStore\FileRepository\NvTelemetry*.dll
  412. rmdir /s /q "%ProgramFiles(x86)%\NVIDIA Corporation\NvTelemetry" 2>nul
  413. rmdir /s /q "%ProgramFiles%\NVIDIA Corporation\NvTelemetry" 2>nul
  414. :: ----------------------------------------------------------
  415.  
  416.  
  417. :: ----------------------------------------------------------
  418. :: --------------Opt out from NVIDIA telemetry---------------
  419. :: ----------------------------------------------------------
  420. echo --- Opt out from NVIDIA telemetry
  421. reg add "HKLM\SOFTWARE\NVIDIA Corporation\NvControlPanel2\Client" /v "OptInOrOutPreference" /t REG_DWORD /d 0 /f
  422. reg add "HKLM\SOFTWARE\NVIDIA Corporation\Global\FTS" /v "EnableRID44231" /t REG_DWORD /d 0 /f
  423. reg add "HKLM\SOFTWARE\NVIDIA Corporation\Global\FTS" /v "EnableRID64640" /t REG_DWORD /d 0 /f
  424. reg add "HKLM\SOFTWARE\NVIDIA Corporation\Global\FTS" /v "EnableRID66610" /t REG_DWORD /d 0 /f
  425. reg add "HKLM\SYSTEM\CurrentControlSet\Services\nvlddmkm\Global\Startup" /v "SendTelemetryData" /t REG_DWORD /d 0 /f
  426. reg add "HKLM\SYSTEM\CurrentControlSet\services\NvTelemetryContainer" /v "Start" /t REG_DWORD /d 4 /f
  427. :: ----------------------------------------------------------
  428.  
  429.  
  430. :: ----------------------------------------------------------
  431. :: ------------Disable NVIDIA telemetry services-------------
  432. :: ----------------------------------------------------------
  433. echo --- Disable NVIDIA telemetry services
  434. schtasks /change /TN NvTmMon_{B2FE1952-0186-46C3-BAEC-A80AA35AC5B8} /DISABLE
  435. schtasks /change /TN NvTmRep_{B2FE1952-0186-46C3-BAEC-A80AA35AC5B8} /DISABLE
  436. schtasks /change /TN NvTmRepOnLogon_{B2FE1952-0186-46C3-BAEC-A80AA35AC5B8} /DISABLE
  437. :: ----------------------------------------------------------
  438.  
  439.  
  440. :: ----------------------------------------------------------
  441. :: -----------Disable Visual Studio Code telemetry-----------
  442. :: ----------------------------------------------------------
  443. echo --- Disable Visual Studio Code telemetry
  444. Powershell -Command "$jsonfile = \"$env:APPDATA\Code\User\settings.json\"; $json = Get-Content $jsonfile | Out-String | ConvertFrom-Json; $json | Add-Member -Type NoteProperty -Name 'telemetry.enableTelemetry' -Value $false -Force; $json | ConvertTo-Json | Set-Content $jsonfile;"
  445. :: ----------------------------------------------------------
  446.  
  447.  
  448. :: ----------------------------------------------------------
  449. :: --------Disable Visual Studio Code crash reporting--------
  450. :: ----------------------------------------------------------
  451. echo --- Disable Visual Studio Code crash reporting
  452. Powershell -Command "$jsonfile = \"$env:APPDATA\Code\User\settings.json\"; $json = Get-Content $jsonfile | Out-String | ConvertFrom-Json; $json | Add-Member -Type NoteProperty -Name 'telemetry.enableCrashReporter' -Value $false -Force; $json | ConvertTo-Json | Set-Content $jsonfile;"
  453. :: ----------------------------------------------------------
  454.  
  455.  
  456. :: ----------------------------------------------------------
  457. :: ---------Do not run Microsoft online experiments----------
  458. :: ----------------------------------------------------------
  459. echo --- Do not run Microsoft online experiments
  460. Powershell -Command "$jsonfile = \"$env:APPDATA\Code\User\settings.json\"; $json = Get-Content $jsonfile | Out-String | ConvertFrom-Json; $json | Add-Member -Type NoteProperty -Name 'workbench.enableExperiments' -Value $false -Force; $json | ConvertTo-Json | Set-Content $jsonfile;"
  461. :: ----------------------------------------------------------
  462.  
  463.  
  464. :: ----------------------------------------------------------
  465. :: -------------Disable Microsoft Office logging-------------
  466. :: ----------------------------------------------------------
  467. echo --- Disable Microsoft Office logging
  468. reg add "HKCU\SOFTWARE\Microsoft\Office\15.0\Outlook\Options\Mail" /v "EnableLogging" /t REG_DWORD /d 0 /f
  469. reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Outlook\Options\Mail" /v "EnableLogging" /t REG_DWORD /d 0 /f
  470. reg add "HKCU\SOFTWARE\Microsoft\Office\15.0\Outlook\Options\Calendar" /v "EnableCalendarLogging" /t REG_DWORD /d 0 /f
  471. reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Outlook\Options\Calendar" /v "EnableCalendarLogging" /t REG_DWORD /d 0 /f
  472. reg add "HKCU\SOFTWARE\Microsoft\Office\15.0\Word\Options" /v "EnableLogging" /t REG_DWORD /d 0 /f
  473. reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Word\Options" /v "EnableLogging" /t REG_DWORD /d 0 /f
  474. reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\15.0\OSM" /v "EnableLogging" /t REG_DWORD /d 0 /f
  475. reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\16.0\OSM" /v "EnableLogging" /t REG_DWORD /d 0 /f
  476. reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\15.0\OSM" /v "EnableUpload" /t REG_DWORD /d 0 /f
  477. reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\16.0\OSM" /v "EnableUpload" /t REG_DWORD /d 0 /f
  478. :: ----------------------------------------------------------
  479.  
  480.  
  481. :: ----------------------------------------------------------
  482. :: -----------------Disable client telemetry-----------------
  483. :: ----------------------------------------------------------
  484. echo --- Disable client telemetry
  485. reg add "HKCU\SOFTWARE\Microsoft\Office\Common\ClientTelemetry" /v "DisableTelemetry" /t REG_DWORD /d 1 /f
  486. reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Common\ClientTelemetry" /v "DisableTelemetry" /t REG_DWORD /d 1 /f
  487. reg add "HKCU\SOFTWARE\Microsoft\Office\Common\ClientTelemetry" /v "VerboseLogging" /t REG_DWORD /d 0 /f
  488. reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Common\ClientTelemetry" /v "VerboseLogging" /t REG_DWORD /d 0 /f
  489. :: ----------------------------------------------------------
  490.  
  491.  
  492. :: ----------------------------------------------------------
  493. :: ---------Customer Experience Improvement Program----------
  494. :: ----------------------------------------------------------
  495. echo --- Customer Experience Improvement Program
  496. reg add "HKCU\SOFTWARE\Microsoft\Office\15.0\Common" /v "QMEnable" /t REG_DWORD /d 0 /f
  497. reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Common" /v "QMEnable" /t REG_DWORD /d 0 /f
  498. :: ----------------------------------------------------------
  499.  
  500.  
  501. :: ----------------------------------------------------------
  502. :: ---------------------Disable feedback---------------------
  503. :: ----------------------------------------------------------
  504. echo --- Disable feedback
  505. reg add "HKCU\SOFTWARE\Microsoft\Office\15.0\Common\Feedback" /v "Enabled" /t REG_DWORD /d 0 /f
  506. reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Common\Feedback" /v "Enabled" /t REG_DWORD /d 0 /f
  507. :: ----------------------------------------------------------
  508.  
  509.  
  510. :: ----------------------------------------------------------
  511. :: -----------------Disable telemetry agent------------------
  512. :: ----------------------------------------------------------
  513. echo --- Disable telemetry agent
  514. schtasks /change /TN "Microsoft\Office\OfficeTelemetryAgentFallBack" /DISABLE
  515. schtasks /change /TN "Microsoft\Office\OfficeTelemetryAgentFallBack2016" /DISABLE
  516. schtasks /change /TN "Microsoft\Office\OfficeTelemetryAgentLogOn" /DISABLE
  517. schtasks /change /TN "Microsoft\Office\OfficeTelemetryAgentLogOn2016" /DISABLE
  518. :: ----------------------------------------------------------
  519.  
  520.  
  521. :: ----------------------------------------------------------
  522. :: ------------Disable live tile data collection-------------
  523. :: ----------------------------------------------------------
  524. echo --- Disable live tile data collection
  525. reg add "HKCU\Software\Policies\Microsoft\MicrosoftEdge\Main" /v "PreventLiveTileDataCollection" /t REG_DWORD /d 1 /f
  526. :: ----------------------------------------------------------
  527.  
  528.  
  529. :: ----------------------------------------------------------
  530. :: -------------------Disable MFU tracking-------------------
  531. :: ----------------------------------------------------------
  532. echo --- Disable MFU tracking
  533. reg add "HKCU\Software\Policies\Microsoft\Windows\EdgeUI" /v "DisableMFUTracking" /t REG_DWORD /d 1 /f
  534. :: ----------------------------------------------------------
  535.  
  536.  
  537. :: ----------------------------------------------------------
  538. :: -------------------Disable recent apps--------------------
  539. :: ----------------------------------------------------------
  540. echo --- Disable recent apps
  541. reg add "HKCU\Software\Policies\Microsoft\Windows\EdgeUI" /v "DisableRecentApps" /t REG_DWORD /d 1 /f
  542. :: ----------------------------------------------------------
  543.  
  544.  
  545. :: ----------------------------------------------------------
  546. :: ------------------Turn off backtracking-------------------
  547. :: ----------------------------------------------------------
  548. echo --- Turn off backtracking
  549. reg add "HKCU\Software\Policies\Microsoft\Windows\EdgeUI" /v "TurnOffBackstack" /t REG_DWORD /d 1 /f
  550. :: ----------------------------------------------------------
  551.  
  552.  
  553. :: ----------------------------------------------------------
  554. :: ------------Disable Search Suggestions in Edge------------
  555. :: ----------------------------------------------------------
  556. echo --- Disable Search Suggestions in Edge
  557. reg add "HKLM\SOFTWARE\Policies\Microsoft\MicrosoftEdge\SearchScopes" /v "ShowSearchSuggestionsGlobal" /t REG_DWORD /d 0 /f
  558. :: ----------------------------------------------------------
  559.  
  560.  
  561. :: ----------------------------------------------------------
  562. :: ---Disable Edge usage and crash-related data reporting----
  563. :: ----------------------------------------------------------
  564. echo --- Disable Edge usage and crash-related data reporting
  565. reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /v "MetricsReportingEnabled" /t REG_DWORD /d 0 /f
  566. :: ----------------------------------------------------------
  567.  
  568.  
  569. :: ----------------------------------------------------------
  570. :: -------------Disable sending site information-------------
  571. :: ----------------------------------------------------------
  572. echo --- Disable sending site information
  573. reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /v "SendSiteInfoToImproveServices" /t REG_DWORD /d 0 /f
  574. :: ----------------------------------------------------------
  575.  
  576.  
  577. :: ----------------------------------------------------------
  578. :: ---------Disable Geolocation in Internet Explorer---------
  579. :: ----------------------------------------------------------
  580. echo --- Disable Geolocation in Internet Explorer
  581. reg add "HKCU\Software\Policies\Microsoft\Internet Explorer\Geolocation" /v "PolicyDisableGeolocation" /t REG_DWORD /d 1 /f
  582. :: ----------------------------------------------------------
  583.  
  584.  
  585. :: ----------------------------------------------------------
  586. :: -------Disable Internet Explorer InPrivate logging--------
  587. :: ----------------------------------------------------------
  588. echo --- Disable Internet Explorer InPrivate logging
  589. reg add "HKLM\SOFTWARE\Policies\Microsoft\Internet Explorer\Safety\PrivacIE" /v "DisableLogging" /t REG_DWORD /d 1 /f
  590. :: ----------------------------------------------------------
  591.  
  592.  
  593. :: ----------------------------------------------------------
  594. :: --------------Disable Internet Explorer CEIP--------------
  595. :: ----------------------------------------------------------
  596. echo --- Disable Internet Explorer CEIP
  597. reg add "HKLM\SOFTWARE\Policies\Microsoft\Internet Explorer\SQM" /v "DisableCustomerImprovementProgram" /t REG_DWORD /d 0 /f
  598. :: ----------------------------------------------------------
  599.  
  600.  
  601. :: ----------------------------------------------------------
  602. :: -----------Disable calling legacy WCM policies------------
  603. :: ----------------------------------------------------------
  604. echo --- Disable calling legacy WCM policies
  605. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" /v "CallLegacyWCMPolicies" /t REG_DWORD /d 0 /f
  606. :: ----------------------------------------------------------
  607.  
  608.  
  609. :: ----------------------------------------------------------
  610. :: ------------------Disable SSLv3 fallback------------------
  611. :: ----------------------------------------------------------
  612. echo --- Disable SSLv3 fallback
  613. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" /v "EnableSSL3Fallback" /t REG_DWORD /d 0 /f
  614. :: ----------------------------------------------------------
  615.  
  616.  
  617. :: ----------------------------------------------------------
  618. :: ---------------Disable ignoring cert errors---------------
  619. :: ----------------------------------------------------------
  620. echo --- Disable ignoring cert errors
  621. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" /v "PreventIgnoreCertErrors" /t REG_DWORD /d 1 /f
  622. :: ----------------------------------------------------------
  623.  
  624.  
  625. :: ----------------------------------------------------------
  626. :: ----------Disable Chrome Software Reporter Tool-----------
  627. :: ----------------------------------------------------------
  628. echo --- Disable Chrome Software Reporter Tool
  629. icacls "%localappdata%\Google\Chrome\User Data\SwReporter" /inheritance:r /deny "*S-1-1-0:(OI)(CI)(F)" "*S-1-5-7:(OI)(CI)(F)"
  630. cacls "%localappdata%\Google\Chrome\User Data\SwReporter" /e /c /d %username%
  631. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "DisallowRun" /t REG_DWORD /d 1 /f
  632. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v "1" /t REG_SZ /d "software_reporter_tool.exe" /f
  633. :: ----------------------------------------------------------
  634.  
  635.  
  636. :: ----------------------------------------------------------
  637. :: -------------Disable Chrome metrics reporting-------------
  638. :: ----------------------------------------------------------
  639. echo --- Disable Chrome metrics reporting
  640. reg add "HKLM\SOFTWARE\Policies\Google\Chrome" /v "MetricsReportingEnabled" /t REG_DWORD /d 0 /f
  641. :: ----------------------------------------------------------
  642.  
  643.  
  644. :: ----------------------------------------------------------
  645. :: -------Do not share scanned software data to Google-------
  646. :: ----------------------------------------------------------
  647. echo --- Do not share scanned software data to Google
  648. reg add "HKLM\SOFTWARE\Policies\Google\Chrome" /v "ChromeCleanupReportingEnabled" /t REG_DWORD /d 0 /f
  649. :: ----------------------------------------------------------
  650.  
  651.  
  652. :: ----------------------------------------------------------
  653. :: ---Prevent Chrome from scanning the system for cleanup----
  654. :: ----------------------------------------------------------
  655. echo --- Prevent Chrome from scanning the system for cleanup
  656. reg add "HKLM\SOFTWARE\Policies\Google\Chrome" /v "ChromeCleanupEnabled" /t REG_DWORD /d 0 /f
  657. :: ----------------------------------------------------------
  658.  
  659.  
  660. :: ----------------------------------------------------------
  661. :: ------------Disable Firefox metrics reporting-------------
  662. :: ----------------------------------------------------------
  663. echo --- Disable Firefox metrics reporting
  664. reg add HKLM\SOFTWARE\Policies\Mozilla\Firefox /v DisableTelemetry /t REG_DWORD /d 1 /f
  665. :: ----------------------------------------------------------
  666.  
  667.  
  668. :: ----------------------------------------------------------
  669. :: ------Disable default browser agent reporting policy------
  670. :: ----------------------------------------------------------
  671. echo --- Disable default browser agent reporting policy
  672. reg add HKLM\SOFTWARE\Policies\Mozilla\Firefox /v DisableDefaultBrowserAgent /t REG_DWORD /d 1 /f
  673. :: ----------------------------------------------------------
  674.  
  675.  
  676. :: ----------------------------------------------------------
  677. :: -----Disable default browser agent reporting services-----
  678. :: ----------------------------------------------------------
  679. echo --- Disable default browser agent reporting services
  680. schtasks.exe /change /disable /tn "\Mozilla\Firefox Default Browser Agent 308046B0AF4A39CB"
  681. schtasks.exe /change /disable /tn "\Mozilla\Firefox Default Browser Agent D2CEEC440E2074BD"
  682. :: ----------------------------------------------------------
  683.  
  684.  
  685. :: ----------------------------------------------------------
  686. :: -------Do not send Windows Media Player statistics--------
  687. :: ----------------------------------------------------------
  688. echo --- Do not send Windows Media Player statistics
  689. reg add "HKCU\SOFTWARE\Microsoft\MediaPlayer\Preferences" /v "UsageTracking" /t REG_DWORD /d 0 /f
  690. :: ----------------------------------------------------------
  691.  
  692.  
  693. :: ----------------------------------------------------------
  694. :: ----------------Disable metadata retrieval----------------
  695. :: ----------------------------------------------------------
  696. echo --- Disable metadata retrieval
  697. reg add "HKCU\Software\Policies\Microsoft\WindowsMediaPlayer" /v "PreventCDDVDMetadataRetrieval" /t REG_DWORD /d 1 /f
  698. reg add "HKCU\Software\Policies\Microsoft\WindowsMediaPlayer" /v "PreventMusicFileMetadataRetrieval" /t REG_DWORD /d 1 /f
  699. reg add "HKCU\Software\Policies\Microsoft\WindowsMediaPlayer" /v "PreventRadioPresetsRetrieval" /t REG_DWORD /d 1 /f
  700. reg add "HKLM\SOFTWARE\Policies\Microsoft\WMDRM" /v "DisableOnline" /t REG_DWORD /d 1 /f
  701. :: ----------------------------------------------------------
  702.  
  703.  
  704. :: ----------------------------------------------------------
  705. :: ----Disable dows Media Player Network Sharing Service-----
  706. :: ----------------------------------------------------------
  707. echo --- Disable dows Media Player Network Sharing Service
  708. sc stop "WMPNetworkSvc" & sc config "WMPNetworkSvc" start=disabled
  709. :: ----------------------------------------------------------
  710.  
  711.  
  712. :: ----------------------------------------------------------
  713. :: --------------Disable administrative shares---------------
  714. :: ----------------------------------------------------------
  715. echo --- Disable administrative shares
  716. reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v "AutoShareWks" /t REG_DWORD /d 0 /f
  717. :: ----------------------------------------------------------
  718.  
  719.  
  720. :: ----------------------------------------------------------
  721. :: ---------------Disable AutoPlay and AutoRun---------------
  722. :: ----------------------------------------------------------
  723. echo --- Disable AutoPlay and AutoRun
  724. :: 255 (0xff) means all drives
  725. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /t REG_DWORD /d 255 /f
  726. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoAutorun" /t REG_DWORD /d 1 /f
  727. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "NoAutoplayfornonVolume" /t REG_DWORD /d 1 /f
  728. :: ----------------------------------------------------------
  729.  
  730.  
  731. :: ----------------------------------------------------------
  732. :: -Prevent the storage of the LAN Manager hash of passwords-
  733. :: ----------------------------------------------------------
  734. echo --- Prevent the storage of the LAN Manager hash of passwords
  735. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "NoLMHash" /t REG_DWORD /d 1 /f
  736. :: ----------------------------------------------------------
  737.  
  738.  
  739. :: Disable Windows Installer Always install with elevated privileges
  740. echo --- Disable Windows Installer Always install with elevated privileges
  741. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer" /v "AlwaysInstallElevated" /t REG_DWORD /d 0 /f
  742. :: ----------------------------------------------------------
  743.  
  744.  
  745. :: ----------------------------------------------------------
  746. :: ------Prevent WinRM from using Basic Authentication-------
  747. :: ----------------------------------------------------------
  748. echo --- Prevent WinRM from using Basic Authentication
  749. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client" /v "AllowBasic" /t REG_DWORD /d 0 /f
  750. :: ----------------------------------------------------------
  751.  
  752.  
  753. :: ----------------------------------------------------------
  754. :: ---------Restrict anonymous enumeration of shares---------
  755. :: ----------------------------------------------------------
  756. echo --- Restrict anonymous enumeration of shares
  757. reg add "HKLM\SYSTEM\CurrentControlSet\Control\LSA" /v "RestrictAnonymous" /t REG_DWORD /d 1 /f
  758. :: ----------------------------------------------------------
  759.  
  760.  
  761. :: ----------------------------------------------------------
  762. :: ------------Refuse less secure authentication-------------
  763. :: ----------------------------------------------------------
  764. echo --- Refuse less secure authentication
  765. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "LmCompatibilityLevel" /t REG_DWORD /d 5 /f
  766. :: ----------------------------------------------------------
  767.  
  768.  
  769. :: Enable Structured Exception Handling Overwrite Protection (SEHOP)
  770. echo --- Enable Structured Exception Handling Overwrite Protection (SEHOP)
  771. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "DisableExceptionChainValidation" /t REG_DWORD /d 0 /f
  772. :: ----------------------------------------------------------
  773.  
  774.  
  775. :: ----------------------------------------------------------
  776. :: -------Block Anonymous enumeration of SAM accounts--------
  777. :: ----------------------------------------------------------
  778. echo --- Block Anonymous enumeration of SAM accounts
  779. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "RestrictAnonymousSAM" /t REG_DWORD /d 1 /f
  780. :: ----------------------------------------------------------
  781.  
  782.  
  783. :: ----------------------------------------------------------
  784. :: ---Restrict anonymous access to Named Pipes and Shares----
  785. :: ----------------------------------------------------------
  786. echo --- Restrict anonymous access to Named Pipes and Shares
  787. reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters" /v "RestrictNullSessAccess" /t REG_DWORD /d 1 /f
  788. :: ----------------------------------------------------------
  789.  
  790.  
  791. :: ----------------------------------------------------------
  792. :: ----------Disable the Windows Connect Now wizard----------
  793. :: ----------------------------------------------------------
  794. echo --- Disable the Windows Connect Now wizard
  795. reg add "HKLM\Software\Policies\Microsoft\Windows\WCN\UI" /v "DisableWcnUi" /t REG_DWORD /d 1 /f
  796. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableFlashConfigRegistrar" /t REG_DWORD /d 0 /f
  797. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableInBand802DOT11Registrar" /t REG_DWORD /d 0 /f
  798. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableUPnPRegistrar" /t REG_DWORD /d 0 /f
  799. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableWPDRegistrar" /t REG_DWORD /d 0 /f
  800. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "EnableRegistrars" /t REG_DWORD /d 0 /f
  801. :: ----------------------------------------------------------
  802.  
  803.  
  804. :: ----------------------------------------------------------
  805. :: --------------Disable unsafe SMBv1 protocol---------------
  806. :: ----------------------------------------------------------
  807. echo --- Disable unsafe SMBv1 protocol
  808. dism /online /Disable-Feature /FeatureName:"SMB1Protocol" /NoRestart
  809. dism /Online /Disable-Feature /FeatureName:"SMB1Protocol-Client" /NoRestart
  810. dism /Online /Disable-Feature /FeatureName:"SMB1Protocol-Server" /NoRestart
  811. :: ----------------------------------------------------------
  812.  
  813.  
  814. :: ----------------------------------------------------------
  815. :: -----Disable PowerShell 2.0 against downgrade attacks-----
  816. :: ----------------------------------------------------------
  817. echo --- Disable PowerShell 2.0 against downgrade attacks
  818. dism /online /Disable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2Root" /NoRestart
  819. dism /online /Disable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2" /NoRestart
  820. :: ----------------------------------------------------------
  821.  
  822.  
  823. :: ----------------------------------------------------------
  824. :: ----------Disable Live Tiles push notifications-----------
  825. :: ----------------------------------------------------------
  826. echo --- Disable Live Tiles push notifications
  827. reg add "HKCU\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" /v "NoTileApplicationNotification" /t REG_DWORD /d 1 /f
  828. :: ----------------------------------------------------------
  829.  
  830.  
  831. :: ----------------------------------------------------------
  832. :: -------------------Disable online tips--------------------
  833. :: ----------------------------------------------------------
  834. echo --- Disable online tips
  835. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "AllowOnlineTips" /t REG_DWORD /d 0 /f
  836. :: ----------------------------------------------------------
  837.  
  838.  
  839. :: ----------------------------------------------------------
  840. :: --------Turn off Internet File Association service--------
  841. :: ----------------------------------------------------------
  842. echo --- Turn off Internet File Association service
  843. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInternetOpenWith" /t REG_DWORD /d 1 /f
  844. :: ----------------------------------------------------------
  845.  
  846.  
  847. :: ----------------------------------------------------------
  848. :: ---------Turn off the "Order Prints" picture task---------
  849. :: ----------------------------------------------------------
  850. echo --- Turn off the "Order Prints" picture task
  851. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoOnlinePrintsWizard" /t REG_DWORD /d 1 /f
  852. :: ----------------------------------------------------------
  853.  
  854.  
  855. :: ----------------------------------------------------------
  856. :: ----Disable the file and folder Publish to Web option-----
  857. :: ----------------------------------------------------------
  858. echo --- Disable the file and folder Publish to Web option
  859. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoPublishingWizard" /t REG_DWORD /d 1 /f
  860. :: ----------------------------------------------------------
  861.  
  862.  
  863. :: ----------------------------------------------------------
  864. :: ---Prevent downloading a list of providers for wizards----
  865. :: ----------------------------------------------------------
  866. echo --- Prevent downloading a list of providers for wizards
  867. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoWebServices" /t REG_DWORD /d 1 /f
  868. :: ----------------------------------------------------------
  869.  
  870.  
  871. :: ----------------------------------------------------------
  872. :: -------Delivery Optimization (P2P Windows Updates)--------
  873. :: ----------------------------------------------------------
  874. echo --- Delivery Optimization (P2P Windows Updates)
  875. sc stop "DoSvc" & sc config "DoSvc" start=disabled
  876. :: ----------------------------------------------------------
  877.  
  878.  
  879. :: ----------------------------------------------------------
  880. :: ---------Program Compatibility Assistant Service----------
  881. :: ----------------------------------------------------------
  882. echo --- Program Compatibility Assistant Service
  883. sc stop "PcaSvc" & sc config "PcaSvc" start=disabled
  884. :: ----------------------------------------------------------
  885.  
  886.  
  887. :: ----------------------------------------------------------
  888. :: -----------------Downloaded Maps Manager------------------
  889. :: ----------------------------------------------------------
  890. echo --- Downloaded Maps Manager
  891. sc stop "MapsBroker" & sc config "MapsBroker" start=disabled
  892. :: ----------------------------------------------------------
  893.  
  894.  
  895. :: ----------------------------------------------------------
  896. :: -------------Microsoft Retail Demo experience-------------
  897. :: ----------------------------------------------------------
  898. echo --- Microsoft Retail Demo experience
  899. sc stop "RetailDemo" & sc config "RetailDemo" start=disabled
  900. :: ----------------------------------------------------------
  901.  
  902.  
  903. :: ----------------------------------------------------------
  904. :: ------------Windows Push Notification Service-------------
  905. :: ----------------------------------------------------------
  906. echo --- Windows Push Notification Service
  907. sc stop "WpnService" & sc config "WpnService" start=disabled
  908. :: ----------------------------------------------------------
  909.  
  910.  
  911. :: ----------------------------------------------------------
  912. :: ----------------Volume Shadow Copy Service----------------
  913. :: ----------------------------------------------------------
  914. echo --- Volume Shadow Copy Service
  915. sc stop "VSS" & sc config "VSS" start=disabled
  916. :: ----------------------------------------------------------
  917.  
  918.  
  919. :: ----------------------------------------------------------
  920. :: ------------------Uninstall Cortana app-------------------
  921. :: ----------------------------------------------------------
  922. echo --- Uninstall Cortana app
  923. PowerShell -Command "Get-AppxPackage 'Microsoft.549981C3F5F10' | Remove-AppxPackage"
  924. :: ----------------------------------------------------------
  925.  
  926.  
  927. :: ----------------------------------------------------------
  928. :: ---------------------Feedback Hub app---------------------
  929. :: ----------------------------------------------------------
  930. echo --- Feedback Hub app
  931. PowerShell -Command "Get-AppxPackage 'Microsoft.WindowsFeedbackHub' | Remove-AppxPackage"
  932. :: ----------------------------------------------------------
  933.  
  934.  
  935. :: ----------------------------------------------------------
  936. :: ---------------------Windows Maps app---------------------
  937. :: ----------------------------------------------------------
  938. echo --- Windows Maps app
  939. PowerShell -Command "Get-AppxPackage 'Microsoft.WindowsMaps' | Remove-AppxPackage"
  940. :: ----------------------------------------------------------
  941.  
  942.  
  943. :: ----------------------------------------------------------
  944. :: ---------------------MSN Weather app----------------------
  945. :: ----------------------------------------------------------
  946. echo --- MSN Weather app
  947. PowerShell -Command "Get-AppxPackage 'Microsoft.BingWeather' | Remove-AppxPackage"
  948. :: ----------------------------------------------------------
  949.  
  950.  
  951. :: ----------------------------------------------------------
  952. :: ----------------------MSN Sports app----------------------
  953. :: ----------------------------------------------------------
  954. echo --- MSN Sports app
  955. PowerShell -Command "Get-AppxPackage 'Microsoft.BingSports' | Remove-AppxPackage"
  956. :: ----------------------------------------------------------
  957.  
  958.  
  959. :: ----------------------------------------------------------
  960. :: -----------------------MSN News app-----------------------
  961. :: ----------------------------------------------------------
  962. echo --- MSN News app
  963. PowerShell -Command "Get-AppxPackage 'Microsoft.BingNews' | Remove-AppxPackage"
  964. :: ----------------------------------------------------------
  965.  
  966.  
  967. :: ----------------------------------------------------------
  968. :: ----------------------MSN Money app-----------------------
  969. :: ----------------------------------------------------------
  970. echo --- MSN Money app
  971. PowerShell -Command "Get-AppxPackage 'Microsoft.BingFinance' | Remove-AppxPackage"
  972. :: ----------------------------------------------------------
  973.  
  974.  
  975. :: ----------------------------------------------------------
  976. :: ----------------------My Office app-----------------------
  977. :: ----------------------------------------------------------
  978. echo --- My Office app
  979. PowerShell -Command "Get-AppxPackage 'Microsoft.MicrosoftOfficeHub' | Remove-AppxPackage"
  980. :: ----------------------------------------------------------
  981.  
  982.  
  983. :: ----------------------------------------------------------
  984. :: ----------------Microsoft Advertising app-----------------
  985. :: ----------------------------------------------------------
  986. echo --- Microsoft Advertising app
  987. PowerShell -Command "Get-AppxPackage 'Microsoft.Advertising.Xaml' | Remove-AppxPackage"
  988. :: ----------------------------------------------------------
  989.  
  990.  
  991. :: ----------------------------------------------------------
  992. :: ------------------Network Speed Test app------------------
  993. :: ----------------------------------------------------------
  994. echo --- Network Speed Test app
  995. PowerShell -Command "Get-AppxPackage 'Microsoft.NetworkSpeedTest' | Remove-AppxPackage"
  996. :: ----------------------------------------------------------
  997.  
  998.  
  999. :: ----------------------------------------------------------
  1000. :: ----------------Holographic First Run app-----------------
  1001. :: ----------------------------------------------------------
  1002. echo --- Holographic First Run app
  1003. PowerShell -Command " $package = (Get-AppxPackage -AllUsers 'Microsoft.Windows.Holographic.FirstRun'); if (!$package) { Write-Host 'Not installed'; exit 0; } $directories = @($package.InstallLocation, \"$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)\"); foreach($dir in $directories) { if ( !$dir -Or !(Test-Path \"$dir\") ) { continue; } cmd /c ('takeown /f \"' + $dir + '\" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } cmd /c ('icacls \"' + $dir + '\" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) { if($file.Name.EndsWith('.OLD')) { continue; } $newName = $file.FullName + '.OLD'; Write-Host \"Rename '$($file.FullName)' to '$newName'\"; Move-Item -LiteralPath \"$($file.FullName)\" -Destination \"$newName\" -Force; } };"
  1004. :: ----------------------------------------------------------
  1005.  
  1006.  
  1007. :: ----------------------------------------------------------
  1008. :: -----Windows 10 Family Safety / Parental Controls app-----
  1009. :: ----------------------------------------------------------
  1010. echo --- Windows 10 Family Safety / Parental Controls app
  1011. PowerShell -Command " $package = (Get-AppxPackage -AllUsers 'Microsoft.Windows.ParentalControls'); if (!$package) { Write-Host 'Not installed'; exit 0; } $directories = @($package.InstallLocation, \"$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)\"); foreach($dir in $directories) { if ( !$dir -Or !(Test-Path \"$dir\") ) { continue; } cmd /c ('takeown /f \"' + $dir + '\" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } cmd /c ('icacls \"' + $dir + '\" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) { if($file.Name.EndsWith('.OLD')) { continue; } $newName = $file.FullName + '.OLD'; Write-Host \"Rename '$($file.FullName)' to '$newName'\"; Move-Item -LiteralPath \"$($file.FullName)\" -Destination \"$newName\" -Force; } };"
  1012. :: ----------------------------------------------------------
  1013.  
  1014.  
  1015. :: ----------------------------------------------------------
  1016. :: -------------------Windows Feedback app-------------------
  1017. :: ----------------------------------------------------------
  1018. echo --- Windows Feedback app
  1019. PowerShell -Command " $package = (Get-AppxPackage -AllUsers 'Microsoft.WindowsFeedback'); if (!$package) { Write-Host 'Not installed'; exit 0; } $directories = @($package.InstallLocation, \"$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)\"); foreach($dir in $directories) { if ( !$dir -Or !(Test-Path \"$dir\") ) { continue; } cmd /c ('takeown /f \"' + $dir + '\" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } cmd /c ('icacls \"' + $dir + '\" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) { if($file.Name.EndsWith('.OLD')) { continue; } $newName = $file.FullName + '.OLD'; Write-Host \"Rename '$($file.FullName)' to '$newName'\"; Move-Item -LiteralPath \"$($file.FullName)\" -Destination \"$newName\" -Force; } };"
  1020. :: ----------------------------------------------------------
  1021.  
  1022.  
  1023. :: ----------------------------------------------------------
  1024. :: ---------------------CBS Preview app----------------------
  1025. :: ----------------------------------------------------------
  1026. echo --- CBS Preview app
  1027. PowerShell -Command " $package = (Get-AppxPackage -AllUsers 'Windows.CBSPreview'); if (!$package) { Write-Host 'Not installed'; exit 0; } $directories = @($package.InstallLocation, \"$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)\"); foreach($dir in $directories) { if ( !$dir -Or !(Test-Path \"$dir\") ) { continue; } cmd /c ('takeown /f \"' + $dir + '\" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } cmd /c ('icacls \"' + $dir + '\" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) { if($file.Name.EndsWith('.OLD')) { continue; } $newName = $file.FullName + '.OLD'; Write-Host \"Rename '$($file.FullName)' to '$newName'\"; Move-Item -LiteralPath \"$($file.FullName)\" -Destination \"$newName\" -Force; } };"
  1028. :: ----------------------------------------------------------
  1029.  
  1030.  
  1031. :: ----------------------------------------------------------
  1032. :: -----------Clear previous Windows installations-----------
  1033. :: ----------------------------------------------------------
  1034. echo --- Clear previous Windows installations
  1035. if exist "%SystemDrive%\Windows.old" (
  1036. takeown /f "%SystemDrive%\Windows.old" /a /r /d y
  1037. icacls "%SystemDrive%\Windows.old" /grant administrators:F /t
  1038. rd /s /q "%SystemDrive%\Windows.old"
  1039. echo Deleted previous installation from "%SystemDrive%\Windows.old\"
  1040. ) else (
  1041. echo No previous Windows installation has been found
  1042. )
  1043. :: ----------------------------------------------------------
  1044.  
  1045.  
  1046. :: ----------------------------------------------------------
  1047. :: -------------------Do not allow Cortana-------------------
  1048. :: ----------------------------------------------------------
  1049. echo --- Do not allow Cortana
  1050. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /t REG_DWORD /d 0 /f
  1051. :: ----------------------------------------------------------
  1052.  
  1053.  
  1054. :: ----------------------------------------------------------
  1055. :: -------------Do not allow Cortana experience--------------
  1056. :: ----------------------------------------------------------
  1057. echo --- Do not allow Cortana experience
  1058. reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\Experience\AllowCortana" /v "value" /t REG_DWORD /d 0 /f
  1059. :: ----------------------------------------------------------
  1060.  
  1061.  
  1062. :: Do not allow search and Cortana to search cloud sources like OneDrive and SharePoint
  1063. echo --- Do not allow search and Cortana to search cloud sources like OneDrive and SharePoint
  1064. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCloudSearch" /t REG_DWORD /d 0 /f
  1065. :: ----------------------------------------------------------
  1066.  
  1067.  
  1068. :: Disable Cortana speech interaction while the system is locked
  1069. echo --- Disable Cortana speech interaction while the system is locked
  1070. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortanaAboveLock" /t REG_DWORD /d 0 /f
  1071. :: ----------------------------------------------------------
  1072.  
  1073.  
  1074. :: ----------------------------------------------------------
  1075. :: ---------------Opt out from Cortana consent---------------
  1076. :: ----------------------------------------------------------
  1077. echo --- Opt out from Cortana consent
  1078. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Search" /v "CortanaConsent" /t REG_DWORD /d 0 /f
  1079. :: ----------------------------------------------------------
  1080.  
  1081.  
  1082. :: ----------------------------------------------------------
  1083. :: ------------Do not allow Cortana to be enabled------------
  1084. :: ----------------------------------------------------------
  1085. echo --- Do not allow Cortana to be enabled
  1086. reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "CanCortanaBeEnabled" /t REG_DWORD /d 0 /f
  1087. :: ----------------------------------------------------------
  1088.  
  1089.  
  1090. :: ----------------------------------------------------------
  1091. :: -Disable Cortana (Internet search results in start menu)--
  1092. :: ----------------------------------------------------------
  1093. echo --- Disable Cortana (Internet search results in start menu)
  1094. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "CortanaEnabled" /t REG_DWORD /d 0 /f
  1095. reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "CortanaEnabled" /t REG_DWORD /d 0 /f
  1096. :: ----------------------------------------------------------
  1097.  
  1098.  
  1099. :: ----------------------------------------------------------
  1100. :: -------------Remove the Cortana taskbar icon--------------
  1101. :: ----------------------------------------------------------
  1102. echo --- Remove the Cortana taskbar icon
  1103. reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v "ShowCortanaButton" /t REG_DWORD /d 0 /f
  1104. :: ----------------------------------------------------------
  1105.  
  1106.  
  1107. :: ----------------------------------------------------------
  1108. :: -----Disable search indexing encrypted items / stores-----
  1109. :: ----------------------------------------------------------
  1110. echo --- Disable search indexing encrypted items / stores
  1111. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowIndexingEncryptedStoresOrItems" /t REG_DWORD /d 0 /f
  1112. :: ----------------------------------------------------------
  1113.  
  1114.  
  1115. :: ----------------------------------------------------------
  1116. :: -----------Do not allow search to use location------------
  1117. :: ----------------------------------------------------------
  1118. echo --- Do not allow search to use location
  1119. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowSearchToUseLocation" /t REG_DWORD /d 0 /f
  1120. :: ----------------------------------------------------------
  1121.  
  1122.  
  1123. :: ----------------------------------------------------------
  1124. :: -------------Disable web search in search bar-------------
  1125. :: ----------------------------------------------------------
  1126. echo --- Disable web search in search bar
  1127. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "DisableWebSearch" /t REG_DWORD /d 1 /f
  1128. :: ----------------------------------------------------------
  1129.  
  1130.  
  1131. :: ----------------------------------------------------------
  1132. :: -------------------Disable Bing search--------------------
  1133. :: ----------------------------------------------------------
  1134. echo --- Disable Bing search
  1135. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "BingSearchEnabled" /t REG_DWORD /d 0 /f
  1136. :: ----------------------------------------------------------
  1137.  
  1138.  
  1139. :: ----------------------------------------------------------
  1140. :: ---------------Disable behavior monitoring----------------
  1141. :: ----------------------------------------------------------
  1142. echo --- Disable behavior monitoring
  1143. reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableBehaviorMonitoring" /t REG_DWORD /d "1" /f
  1144. :: ----------------------------------------------------------
  1145.  
  1146.  
  1147. :: ----------------------------------------------------------
  1148. :: Disable scanning for all downloaded files and attachments-
  1149. :: ----------------------------------------------------------
  1150. echo --- Disable scanning for all downloaded files and attachments
  1151. reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableIOAVProtection" /t REG_DWORD /d "1" /f
  1152. :: ----------------------------------------------------------
  1153.  
  1154.  
  1155. :: ----------------------------------------------------------
  1156. :: -------Disable monitoring file and program activity-------
  1157. :: ----------------------------------------------------------
  1158. echo --- Disable monitoring file and program activity
  1159. reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableOnAccessProtection" /t REG_DWORD /d "1" /f
  1160. :: ----------------------------------------------------------
  1161.  
  1162.  
  1163. :: ----------------------------------------------------------
  1164. :: Disable automatically taking action on all detected tasks-
  1165. :: ----------------------------------------------------------
  1166. echo --- Disable automatically taking action on all detected tasks
  1167. reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableRoutinelyTakingAction" /t REG_DWORD /d "1" /f
  1168. :: ----------------------------------------------------------
  1169.  
  1170.  
  1171. :: ----------------------------------------------------------
  1172. :: -----Disable process scanning on real-time protection-----
  1173. :: ----------------------------------------------------------
  1174. echo --- Disable process scanning on real-time protection
  1175. reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableScanOnRealtimeEnable" /t REG_DWORD /d "1" /f
  1176. :: ----------------------------------------------------------
  1177.  
  1178.  
  1179. :: ----------------------------------------------------------
  1180. :: --------Disable Windows Defender ExploitGuard task--------
  1181. :: ----------------------------------------------------------
  1182. echo --- Disable Windows Defender ExploitGuard task
  1183. schtasks /Change /TN "Microsoft\Windows\ExploitGuard\ExploitGuard MDM policy Refresh" /Disable
  1184. :: ----------------------------------------------------------
  1185.  
  1186.  
  1187. :: ----------------------------------------------------------
  1188. :: -----Disable Windows Defender Cache Maintenance task------
  1189. :: ----------------------------------------------------------
  1190. echo --- Disable Windows Defender Cache Maintenance task
  1191. schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" /Disable
  1192. :: ----------------------------------------------------------
  1193.  
  1194.  
  1195. :: ----------------------------------------------------------
  1196. :: ----------Disable Windows Defender Cleanup task-----------
  1197. :: ----------------------------------------------------------
  1198. echo --- Disable Windows Defender Cleanup task
  1199. schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Cleanup" /Disable
  1200. :: ----------------------------------------------------------
  1201.  
  1202.  
  1203. :: ----------------------------------------------------------
  1204. :: -------Disable Windows Defender Scheduled Scan task-------
  1205. :: ----------------------------------------------------------
  1206. echo --- Disable Windows Defender Scheduled Scan task
  1207. schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan" /Disable
  1208. :: ----------------------------------------------------------
  1209.  
  1210.  
  1211. :: ----------------------------------------------------------
  1212. :: --------Disable Windows Defender Verification task--------
  1213. :: ----------------------------------------------------------
  1214. echo --- Disable Windows Defender Verification task
  1215. schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Verification" /Disable
  1216. :: ----------------------------------------------------------
  1217.  
  1218.  
  1219. :: ----------------------------------------------------------
  1220. :: --------Disable Windows Defender Firewall service---------
  1221. :: ----------------------------------------------------------
  1222. echo --- Disable Windows Defender Firewall service
  1223. reg add "HKLM\SYSTEM\CurrentControlSet\Services\MpsSvc" /v "Start" /t REG_DWORD /d "4" /f
  1224. :: ----------------------------------------------------------
  1225.  
  1226.  
  1227. :: ----------------------------------------------------------
  1228. :: --------Disable Windows Defender Antivirus service--------
  1229. :: ----------------------------------------------------------
  1230. echo --- Disable Windows Defender Antivirus service
  1231. reg add "HKLM\SYSTEM\CurrentControlSet\Services\WinDefend" /v "Start" /t REG_DWORD /d "4" /f
  1232. :: ----------------------------------------------------------
  1233.  
  1234.  
  1235. :: ----------------------------------------------------------
  1236. :: -Disable Microsoft Defender Antivirus Boot Driver service-
  1237. :: ----------------------------------------------------------
  1238. echo --- Disable Microsoft Defender Antivirus Boot Driver service
  1239. reg add "HKLM\SYSTEM\CurrentControlSet\Services\WdBoot" /v "Start" /t REG_DWORD /d "4" /f
  1240. :: ----------------------------------------------------------
  1241.  
  1242.  
  1243. :: Disable Microsoft Defender Antivirus Mini-Filter Driver service
  1244. echo --- Disable Microsoft Defender Antivirus Mini-Filter Driver service
  1245. reg add "HKLM\SYSTEM\CurrentControlSet\Services\WdFilter" /v "Start" /t REG_DWORD /d "4" /f
  1246. :: ----------------------------------------------------------
  1247.  
  1248.  
  1249. :: Disable Microsoft Defender Antivirus Network Inspection System Driver service
  1250. echo --- Disable Microsoft Defender Antivirus Network Inspection System Driver service
  1251. reg add "HKLM\SYSTEM\CurrentControlSet\Services\WdNisDrv" /v "Start" /t REG_DWORD /d "4" /f
  1252. :: ----------------------------------------------------------
  1253.  
  1254.  
  1255. :: Disable Microsoft Defender Antivirus Network Inspection service
  1256. echo --- Disable Microsoft Defender Antivirus Network Inspection service
  1257. reg add "HKLM\SYSTEM\CurrentControlSet\Services\WdNisSvc" /v "Start" /t REG_DWORD /d "4" /f
  1258. :: ----------------------------------------------------------
  1259.  
  1260.  
  1261. :: ----------------------------------------------------------
  1262. :: -------------Disable Windows Security service-------------
  1263. :: ----------------------------------------------------------
  1264. echo --- Disable Windows Security service
  1265. reg add "HKLM\SYSTEM\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d "4" /f
  1266. :: ----------------------------------------------------------
  1267.  
  1268.  
  1269. :: ----------------------------------------------------------
  1270. :: -----------Disable Microsoft Defender Antivirus-----------
  1271. :: ----------------------------------------------------------
  1272. echo --- Disable Microsoft Defender Antivirus
  1273. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v DisableAntiSpyware /t REG_DWORD /d 1 /f
  1274. :: ----------------------------------------------------------
  1275.  
  1276.  
  1277. :: ----------------------------------------------------------
  1278. :: -------------Disable Windows Defender logging-------------
  1279. :: ----------------------------------------------------------
  1280. echo --- Disable Windows Defender logging
  1281. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderApiLogger" /v "Start" /t REG_DWORD /d "0" /f
  1282. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderAuditLogger" /v "Start" /t REG_DWORD /d "0" /f
  1283. :: ----------------------------------------------------------
  1284.  
  1285.  
  1286. :: ----------------------------------------------------------
  1287. :: --------------Turn off block at first sight---------------
  1288. :: ----------------------------------------------------------
  1289. echo --- Turn off block at first sight
  1290. reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "DisableBlockAtFirstSeen" /t REG_DWORD /d "1" /f
  1291. :: ----------------------------------------------------------
  1292.  
  1293.  
  1294. :: ----------------------------------------------------------
  1295. :: --Disable scheduled On Demand anti malware scanner (MRT)--
  1296. :: ----------------------------------------------------------
  1297. echo --- Disable scheduled On Demand anti malware scanner (MRT)
  1298. reg add "HKLM\SOFTWARE\Policies\Microsoft\MRT" /v "DontOfferThroughWUAU" /t REG_DWORD /d 1 /f
  1299. :: ----------------------------------------------------------
  1300.  
  1301.  
  1302. :: ----------------------------------------------------------
  1303. :: ------------------Kill OneDrive process-------------------
  1304. :: ----------------------------------------------------------
  1305. echo --- Kill OneDrive process
  1306. taskkill /f /im OneDrive.exe
  1307. :: ----------------------------------------------------------
  1308.  
  1309.  
  1310. :: ----------------------------------------------------------
  1311. :: --------------------Uninstall OneDrive--------------------
  1312. :: ----------------------------------------------------------
  1313. echo --- Uninstall OneDrive
  1314. if %PROCESSOR_ARCHITECTURE%==x86 (
  1315. %SystemRoot%\System32\OneDriveSetup.exe /uninstall 2>nul
  1316. ) else (
  1317. %SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall 2>nul
  1318. )
  1319. :: ----------------------------------------------------------
  1320.  
  1321.  
  1322. :: ----------------------------------------------------------
  1323. :: ----------------Remove OneDrive leftovers-----------------
  1324. :: ----------------------------------------------------------
  1325. echo --- Remove OneDrive leftovers
  1326. rd "%UserProfile%\OneDrive" /q /s
  1327. rd "%LocalAppData%\Microsoft\OneDrive" /q /s
  1328. rd "%ProgramData%\Microsoft OneDrive" /q /s
  1329. rd "%SystemDrive%\OneDriveTemp" /q /s
  1330. :: ----------------------------------------------------------
  1331.  
  1332.  
  1333. :: ----------------------------------------------------------
  1334. :: ----------------Delete OneDrive shortcuts-----------------
  1335. :: ----------------------------------------------------------
  1336. echo --- Delete OneDrive shortcuts
  1337. del "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Microsoft OneDrive.lnk" /s /f /q
  1338. del "%APPDATA%\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" /s /f /q
  1339. del "%USERPROFILE%\Links\OneDrive.lnk" /s /f /q
  1340. :: ----------------------------------------------------------
  1341.  
  1342.  
  1343. :: ----------------------------------------------------------
  1344. :: ----------------Disable usage of OneDrive-----------------
  1345. :: ----------------------------------------------------------
  1346. echo --- Disable usage of OneDrive
  1347. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /t REG_DWORD /v "DisableFileSyncNGSC" /d 1 /f
  1348. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /t REG_DWORD /v "DisableFileSync" /d 1 /f
  1349. :: ----------------------------------------------------------
  1350.  
  1351.  
  1352. :: ----------------------------------------------------------
  1353. :: ---Prevent automatic OneDrive install for current user----
  1354. :: ----------------------------------------------------------
  1355. echo --- Prevent automatic OneDrive install for current user
  1356. reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f
  1357. :: ----------------------------------------------------------
  1358.  
  1359.  
  1360. :: ----------------------------------------------------------
  1361. :: -----Prevent automatic OneDrive install for new users-----
  1362. :: ----------------------------------------------------------
  1363. echo --- Prevent automatic OneDrive install for new users
  1364. reg load "HKU\Default" "%SystemDrive%\Users\Default\NTUSER.DAT"
  1365. reg delete "HKU\Default\software\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f
  1366. reg unload "HKU\Default"
  1367. :: ----------------------------------------------------------
  1368.  
  1369.  
  1370. :: ----------------------------------------------------------
  1371. :: ------------Remove OneDrive from explorer menu------------
  1372. :: ----------------------------------------------------------
  1373. echo --- Remove OneDrive from explorer menu
  1374. reg delete "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
  1375. reg delete "HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
  1376. reg add "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v System.IsPinnedToNameSpaceTree /d "0" /t REG_DWORD /f
  1377. reg add "HKCR\Wow6432Node\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v System.IsPinnedToNameSpaceTree /d "0" /t REG_DWORD /f
  1378. :: ----------------------------------------------------------
  1379.  
  1380.  
  1381. :: ----------------------------------------------------------
  1382. :: -----------Delete all OneDrive related Services-----------
  1383. :: ----------------------------------------------------------
  1384. echo --- Delete all OneDrive related Services
  1385. for /f "tokens=1 delims=," %%x in ('schtasks /query /fo csv ^| find "OneDrive"') do schtasks /Delete /TN %%x /F
  1386. :: ----------------------------------------------------------
  1387.  
  1388.  
  1389. :: ----------------------------------------------------------
  1390. :: ------------Delete OneDrive path from registry------------
  1391. :: ----------------------------------------------------------
  1392. echo --- Delete OneDrive path from registry
  1393. reg delete "HKCU\Environment" /v "OneDrive" /f
  1394. :: ----------------------------------------------------------
  1395.  
  1396.  
  1397. :: ----------------------------------------------------------
  1398. :: ---Bio enrollment app (breaks biometric authentication)---
  1399. :: ----------------------------------------------------------
  1400. echo --- Bio enrollment app (breaks biometric authentication)
  1401. PowerShell -Command " $package = (Get-AppxPackage -AllUsers 'Microsoft.BioEnrollment'); if (!$package) { Write-Host 'Not installed'; exit 0; } $directories = @($package.InstallLocation, \"$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)\"); foreach($dir in $directories) { if ( !$dir -Or !(Test-Path \"$dir\") ) { continue; } cmd /c ('takeown /f \"' + $dir + '\" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } cmd /c ('icacls \"' + $dir + '\" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) { if($file.Name.EndsWith('.OLD')) { continue; } $newName = $file.FullName + '.OLD'; Write-Host \"Rename '$($file.FullName)' to '$newName'\"; Move-Item -LiteralPath \"$($file.FullName)\" -Destination \"$newName\" -Force; } };"
  1402. :: ----------------------------------------------------------
  1403.  
  1404.  
  1405. :: ----------------------------------------------------------
  1406. :: -------------------Cred Dialog Host app-------------------
  1407. :: ----------------------------------------------------------
  1408. echo --- Cred Dialog Host app
  1409. PowerShell -Command " $package = (Get-AppxPackage -AllUsers 'Microsoft.CredDialogHost'); if (!$package) { Write-Host 'Not installed'; exit 0; } $directories = @($package.InstallLocation, \"$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)\"); foreach($dir in $directories) { if ( !$dir -Or !(Test-Path \"$dir\") ) { continue; } cmd /c ('takeown /f \"' + $dir + '\" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } cmd /c ('icacls \"' + $dir + '\" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) { if($file.Name.EndsWith('.OLD')) { continue; } $newName = $file.FullName + '.OLD'; Write-Host \"Rename '$($file.FullName)' to '$newName'\"; Move-Item -LiteralPath \"$($file.FullName)\" -Destination \"$newName\" -Force; } };"
  1410. :: ----------------------------------------------------------
  1411.  
  1412.  
  1413. :: ----------------------------------------------------------
  1414. :: --------------------------EC app--------------------------
  1415. :: ----------------------------------------------------------
  1416. echo --- EC app
  1417. PowerShell -Command " $package = (Get-AppxPackage -AllUsers 'Microsoft.ECApp'); if (!$package) { Write-Host 'Not installed'; exit 0; } $directories = @($package.InstallLocation, \"$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)\"); foreach($dir in $directories) { if ( !$dir -Or !(Test-Path \"$dir\") ) { continue; } cmd /c ('takeown /f \"' + $dir + '\" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } cmd /c ('icacls \"' + $dir + '\" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) { if($file.Name.EndsWith('.OLD')) { continue; } $newName = $file.FullName + '.OLD'; Write-Host \"Rename '$($file.FullName)' to '$newName'\"; Move-Item -LiteralPath \"$($file.FullName)\" -Destination \"$newName\" -Force; } };"
  1418. :: ----------------------------------------------------------
  1419.  
  1420.  
  1421. :: ----------------------------------------------------------
  1422. :: ---------------Lock app (shows lock screen)---------------
  1423. :: ----------------------------------------------------------
  1424. echo --- Lock app (shows lock screen)
  1425. PowerShell -Command " $package = (Get-AppxPackage -AllUsers 'Microsoft.LockApp'); if (!$package) { Write-Host 'Not installed'; exit 0; } $directories = @($package.InstallLocation, \"$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)\"); foreach($dir in $directories) { if ( !$dir -Or !(Test-Path \"$dir\") ) { continue; } cmd /c ('takeown /f \"' + $dir + '\" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } cmd /c ('icacls \"' + $dir + '\" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership'; } $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) { if($file.Name.EndsWith('.OLD')) { continue; } $newName = $file.FullName + '.OLD'; Write-Host \"Rename '$($file.FullName)' to '$newName'\"; Move-Item -LiteralPath \"$($file.FullName)\" -Destination \"$newName\" -Force; } };"
  1426. :: ----------------------------------------------------------
  1427.  
  1428.  
  1429. :: ----------------------------------------------------------
  1430. :: -----------------------Get Help app-----------------------
  1431. :: ----------------------------------------------------------
  1432. echo --- Get Help app
  1433. PowerShell -Command "Get-AppxPackage 'Microsoft.GetHelp' | Remove-AppxPackage"
  1434. :: ----------------------------------------------------------
  1435.  
  1436.  
  1437. :: ----------------------------------------------------------
  1438. :: --------------------App Installer app---------------------
  1439. :: ----------------------------------------------------------
  1440. echo --- App Installer app
  1441. PowerShell -Command "Get-AppxPackage 'Microsoft.DesktopAppInstaller' | Remove-AppxPackage"
  1442. :: ----------------------------------------------------------
  1443.  
  1444.  
  1445. :: ----------------------------------------------------------
  1446. :: --------------------Microsoft Tips app--------------------
  1447. :: ----------------------------------------------------------
  1448. echo --- Microsoft Tips app
  1449. PowerShell -Command "Get-AppxPackage 'Microsoft.Getstarted' | Remove-AppxPackage"
  1450. :: ----------------------------------------------------------
  1451.  
  1452.  
  1453. :: ----------------------------------------------------------
  1454. :: -----------------Microsoft Messaging app------------------
  1455. :: ----------------------------------------------------------
  1456. echo --- Microsoft Messaging app
  1457. PowerShell -Command "Get-AppxPackage 'Microsoft.Messaging' | Remove-AppxPackage"
  1458. :: ----------------------------------------------------------
  1459.  
  1460.  
  1461. pause
  1462. exit /b 0
Add Comment
Please, Sign In to add comment