Windows10DebloaterGUI.ps1 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. Add-Type -AssemblyName System.Windows.Forms
  2. Add-Type -AssemblyName System.Drawing
  3. $ErrorPreference = 'SilentlyContinue'
  4. $VerbosePreference = 'Continue'
  5. $form = New-Object System.Windows.Forms.Form
  6. $form.Text = 'Windows10Debloater'
  7. $form.Size = New-Object System.Drawing.Size(800,600)
  8. $form.StartPosition = 'CenterScreen'
  9. $OKButton = New-Object System.Windows.Forms.Button
  10. $OKButton.Location = New-Object System.Drawing.Point(275,40)
  11. $OKButton.Size = New-Object System.Drawing.Size(225,23)
  12. $OKButton.Text = 'Remove Selected Bloatware Packages'
  13. $OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
  14. $form.AcceptButton = $OKButton
  15. $form.Controls.Add($OKButton)
  16. $RemoveKeys = New-Object system.Windows.Forms.Button
  17. $RemoveKeys.text = "Remove registry keys associated with Bloatware"
  18. $RemoveKeys.width = 265
  19. $RemoveKeys.height = 23
  20. $RemoveKeys.location = New-Object System.Drawing.Point(275,400)
  21. $form.Controls.Add($RemoveKeys)
  22. #$WhitelistDebloat.Font = 'Microsoft Sans Serif,10'
  23. $ProtectPrivacy = New-Object system.Windows.Forms.Button
  24. $ProtectPrivacy.text = "Disable Telemetry"
  25. $ProtectPrivacy.width = 265
  26. $ProtectPrivacy.height = 23
  27. $ProtectPrivacy.location = New-Object System.Drawing.Point(275,365)
  28. $form.Controls.Add($ProtectPrivacy)
  29. #$WhitelistDebloat.Font = 'Microsoft Sans Serif,10'
  30. $label = New-Object System.Windows.Forms.Label
  31. $label.Location = New-Object System.Drawing.Point(10,20)
  32. $label.Size = New-Object System.Drawing.Size(280,20)
  33. $label.Text = 'Select Default Bloatware Packages To Remove:'
  34. $form.Controls.Add($label)
  35. $listBox = New-Object System.Windows.Forms.ListBox
  36. $listBox.Location = New-Object System.Drawing.Point(10,40)
  37. $listBox.Size = New-Object System.Drawing.Size(260,500)
  38. #$listBox.Height = 80
  39. $label2 = New-Object System.Windows.Forms.Label
  40. $label2.Location = New-Object System.Drawing.Point(275,145)
  41. $label2.Size = New-Object System.Drawing.Size(280,30)
  42. $label2.Text = 'This is used to remove other packages besides the ones chosen on the left hand side'
  43. $form.Controls.Add($label2)
  44. $label3 = New-Object System.Windows.Forms.Label
  45. $label3.Location = New-Object System.Drawing.Point(275,285)
  46. $label3.Size = New-Object System.Drawing.Size(500,15)
  47. $label3.Text = '_______________________________________________________________________________'
  48. $form.Controls.Add($label3)
  49. $label4 = New-Object System.Windows.Forms.Label
  50. $label4.Location = New-Object System.Drawing.Point(275,265)
  51. $label4.Size = New-Object System.Drawing.Size(500,100)
  52. $label4.Text = 'ADVANCED OPTIONS BELOW'
  53. $form.Controls.Add($label4)
  54. $WhitelistDebloat = New-Object system.Windows.Forms.Button
  55. $WhitelistDebloat.text = "Remove extra packages besides the default bloatware"
  56. $WhitelistDebloat.width = 285
  57. $WhitelistDebloat.height = 30
  58. $WhitelistDebloat.location = New-Object System.Drawing.Point(275,175)
  59. #$WhitelistDebloat.Font = 'Microsoft Sans Serif,10'
  60. $Form.controls.AddRange(@($WhitelistDebloat,$RemoveKeys,$ProtectPrivacy))
  61. $WhitelistDebloat.Add_Click({
  62. Function DebloatAll {
  63. #Removes AppxPackages
  64. #Credit to /u/GavinEke for a modified version of my whitelist code
  65. $WhitelistedApps = 'Microsoft.ScreenSketch|Microsoft.Paint3D|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows|`
  66. Microsoft.XboxGameCallableUI|Microsoft.XboxGamingOverlay|Microsoft.Xbox.TCUI|Microsoft.XboxGamingOverlay|Microsoft.XboxIdentityProvider|Microsoft.MicrosoftStickyNotes|Microsoft.MSPaint|Microsoft.WindowsCamera|.NET|Framework|`
  67. Microsoft.HEIFImageExtension|Microsoft.ScreenSketch|Microsoft.StorePurchaseApp|Microsoft.VP9VideoExtensions|Microsoft.WebMediaExtensions|Microsoft.WebpImageExtension|Microsoft.DesktopAppInstaller|WindSynthBerry|MIDIBerry|Slack'
  68. #NonRemovable Apps that where getting attempted and the system would reject the uninstall, speeds up debloat and prevents 'initalizing' overlay when removing apps
  69. $NonRemovable = '1527c705-839a-4832-9118-54d4Bd6a0c89|c5e2524a-ea46-4f67-841f-6a9465d9d515|E2A4F912-2574-4A75-9BB0-0D023378592B|F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE|InputApp|Microsoft.AAD.BrokerPlugin|Microsoft.AccountsControl|`
  70. Microsoft.BioEnrollment|Microsoft.CredDialogHost|Microsoft.ECApp|Microsoft.LockApp|Microsoft.MicrosoftEdgeDevToolsClient|Microsoft.MicrosoftEdge|Microsoft.PPIProjection|Microsoft.Win32WebViewHost|Microsoft.Windows.Apprep.ChxApp|`
  71. Microsoft.Windows.AssignedAccessLockApp|Microsoft.Windows.CapturePicker|Microsoft.Windows.CloudExperienceHost|Microsoft.Windows.ContentDeliveryManager|Microsoft.Windows.Cortana|Microsoft.Windows.NarratorQuickStart|`
  72. Microsoft.Windows.ParentalControls|Microsoft.Windows.PeopleExperienceHost|Microsoft.Windows.PinningConfirmationDialog|Microsoft.Windows.SecHealthUI|Microsoft.Windows.SecureAssessmentBrowser|Microsoft.Windows.ShellExperienceHost|`
  73. Microsoft.Windows.XGpuEjectDialog|Microsoft.XboxGameCallableUI|Windows.CBSPreview|windows.immersivecontrolpanel|Windows.PrintDialog|Microsoft.VCLibs.140.00|Microsoft.Services.Store.Engagement|Microsoft.UI.Xaml.2.0'
  74. Get-AppxPackage -AllUsers | Where {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxPackage
  75. Get-AppxPackage | Where {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxPackage
  76. Get-AppxProvisionedPackage -Online | Where {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxProvisionedPackage -Online
  77. }
  78. Debloatall
  79. })
  80. New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
  81. $RemoveKeys.Add_Click({
  82. Function Remove-Keys {
  83. New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
  84. #These are the registry keys that it will delete.
  85. $Keys = @(
  86. #Remove Background Tasks
  87. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y"
  88. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  89. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe"
  90. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
  91. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
  92. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy"
  93. #Windows File
  94. "HKCR:\Extensions\ContractId\Windows.File\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  95. #Registry keys to delete if they aren't uninstalled by RemoveAppXPackage/RemoveAppXProvisionedPackage
  96. "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y"
  97. "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  98. "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
  99. "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
  100. "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy"
  101. #Scheduled Tasks to delete
  102. "HKCR:\Extensions\ContractId\Windows.PreInstalledConfigTask\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe"
  103. #Windows Protocol Keys
  104. "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  105. "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
  106. "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
  107. "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy"
  108. #Windows Share Target
  109. "HKCR:\Extensions\ContractId\Windows.ShareTarget\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  110. )
  111. #This writes the output of each key it is removing and also removes the keys listed above.
  112. ForEach ($Key in $Keys) {
  113. Write-Verbose "Removing $Key from registry"
  114. Remove-Item $Key -Recurse
  115. }
  116. }
  117. Remove-Keys
  118. })
  119. $ProtectPrivacy.Add_Click({
  120. Function ProtectPrivacy {
  121. #Creates a PSDrive to be able to access the 'HKCR' tree
  122. New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
  123. #Disables Windows Feedback Experience
  124. Write-Host "Disabling Windows Feedback Experience program"
  125. $Advertising = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo'
  126. If (Test-Path $Advertising) {
  127. Set-ItemProperty $Advertising Enabled -Value 0
  128. }
  129. #Stops Cortana from being used as part of your Windows Search Function
  130. Write-Host "Stopping Cortana from being used as part of your Windows Search Function"
  131. $Search = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
  132. If (Test-Path $Search) {
  133. Set-ItemProperty $Search AllowCortana -Value 0
  134. }
  135. #Stops the Windows Feedback Experience from sending anonymous data
  136. Write-Host "Stopping the Windows Feedback Experience program"
  137. $Period1 = 'HKCU:\Software\Microsoft\Siuf'
  138. $Period2 = 'HKCU:\Software\Microsoft\Siuf\Rules'
  139. $Period3 = 'HKCU:\Software\Microsoft\Siuf\Rules\PeriodInNanoSeconds'
  140. If (!(Test-Path $Period3)) {
  141. mkdir $Period1
  142. mkdir $Period2
  143. mkdir $Period3
  144. New-ItemProperty $Period3 PeriodInNanoSeconds -Value 0
  145. }
  146. Write-Host "Adding Registry key to prevent bloatware apps from returning"
  147. #Prevents bloatware applications from returning
  148. $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
  149. If (!(Test-Path $registryPath)) {
  150. Mkdir $registryPath
  151. New-ItemProperty $registryPath DisableWindowsConsumerFeatures -Value 1
  152. }
  153. Write-Host "Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings"
  154. $Holo = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Holographic'
  155. If (Test-Path $Holo) {
  156. Set-ItemProperty $Holo FirstRunSucceeded -Value 0
  157. }
  158. #Disables live tiles
  159. Write-Host "Disabling live tiles"
  160. $Live = 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications'
  161. If (!(Test-Path $Live)) {
  162. mkdir $Live
  163. New-ItemProperty $Live NoTileApplicationNotification -Value 1
  164. }
  165. #Turns off Data Collection via the AllowTelemtry key by changing it to 0
  166. Write-Host "Turning off Data Collection"
  167. $DataCollection = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection'
  168. If (Test-Path $DataCollection) {
  169. Set-ItemProperty $DataCollection AllowTelemetry -Value 0
  170. }
  171. #Disables People icon on Taskbar
  172. Write-Host "Disabling People icon on Taskbar"
  173. $People = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'
  174. If (Test-Path $People) {
  175. Set-ItemProperty $People PeopleBand -Value 0
  176. }
  177. #Disables suggestions on start menu
  178. Write-Host "Disabling suggestions on the Start Menu"
  179. $Suggestions = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
  180. If (Test-Path $Suggestions) {
  181. Set-ItemProperty $Suggestions SystemPaneSuggestionsEnabled -Value 0
  182. }
  183. Write-Host "Removing CloudStore from registry if it exists"
  184. $CloudStore = 'HKCUSoftware\Microsoft\Windows\CurrentVersion\CloudStore'
  185. If (Test-Path $CloudStore) {
  186. Stop-Process Explorer.exe -Force
  187. Remove-Item $CloudStore
  188. Start-Process Explorer.exe -Wait
  189. }
  190. #Loads the registry keys/values below into the NTUSER.DAT file which prevents the apps from redownloading. Credit to a60wattfish
  191. reg load HKU\Default_User C:\Users\Default\NTUSER.DAT
  192. Set-ItemProperty -Path Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SystemPaneSuggestionsEnabled -Value 0
  193. Set-ItemProperty -Path Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name PreInstalledAppsEnabled -Value 0
  194. Set-ItemProperty -Path Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name OemPreInstalledAppsEnabled -Value 0
  195. reg unload HKU\Default_User
  196. #Disables scheduled tasks that are considered unnecessary
  197. Write-Host "Disabling scheduled tasks"
  198. #Get-ScheduledTask -TaskName XblGameSaveTaskLogon | Disable-ScheduledTask
  199. Get-ScheduledTask -TaskName XblGameSaveTask | Disable-ScheduledTask
  200. Get-ScheduledTask -TaskName Consolidator | Disable-ScheduledTask
  201. Get-ScheduledTask -TaskName UsbCeip | Disable-ScheduledTask
  202. Get-ScheduledTask -TaskName DmClient | Disable-ScheduledTask
  203. Get-ScheduledTask -TaskName DmClientOnScenarioDownload | Disable-ScheduledTask
  204. }
  205. ProtectPrivacy
  206. })
  207. $listBox.SelectionMode = 'MultiExtended'
  208. [void] $listBox.Items.Add('Microsoft.BingNews')
  209. [void] $listBox.Items.Add('Microsoft.GetHelp')
  210. [void] $listBox.Items.Add('Microsoft.Getstarted')
  211. [void] $listBox.Items.Add('Microsoft.Messaging')
  212. [void] $listBox.Items.Add('Microsoft.Microsoft3DViewer')
  213. [void] $listBox.Items.Add('Microsoft.MicrosoftOfficeHub')
  214. [void] $listBox.Items.Add('Microsoft.MicrosoftSolitaireCollection')
  215. [void] $listBox.Items.Add('Microsoft.NetworkSpeedTest')
  216. [void] $listBox.Items.Add('Microsoft.News')
  217. [void] $listBox.Items.Add('Microsoft.Office.Lens')
  218. [void] $listBox.Items.Add('Microsoft.Office.OneNote')
  219. [void] $listBox.Items.Add('Microsoft.Office.Sway')
  220. [void] $listBox.Items.Add('Microsoft.OneConnect')
  221. [void] $listBox.Items.Add('Microsoft.People')
  222. [void] $listBox.Items.Add('Microsoft.Print3D')
  223. [void] $listBox.Items.Add('Microsoft.RemoteDesktop')
  224. [void] $listBox.Items.Add('Microsoft.SkypeApp')
  225. [void] $listBox.Items.Add('Microsoft.StorePurchaseApp')
  226. [void] $listBox.Items.Add('Microsoft.Office.Todo.List')
  227. [void] $listBox.Items.Add('Microsoft.Whiteboard')
  228. [void] $listBox.Items.Add('Microsoft.WindowsAlarms')
  229. [void] $listBox.Items.Add('Microsoft.WindowsCamera')
  230. [void] $listBox.Items.Add('microsoft.windowscommunicationsapps')
  231. [void] $listBox.Items.Add('Microsoft.WindowsFeedbackHub')
  232. [void] $listBox.Items.Add('Microsoft.WindowsMaps')
  233. [void] $listBox.Items.Add('Microsoft.WindowsSoundRecorder')
  234. [void] $listBox.Items.Add('Microsoft.Xbox.TCUI')
  235. [void] $listBox.Items.Add('Microsoft.XboxApp')
  236. [void] $listBox.Items.Add('Microsoft.XboxGameOverlay')
  237. [void] $listBox.Items.Add('Microsoft.XboxIdentityProvider')
  238. [void] $listBox.Items.Add('Microsoft.XboxSpeechToTextOverlay')
  239. [void] $listBox.Items.Add('Microsoft.ZuneMusic')
  240. [void] $listBox.Items.Add('Microsoft.ZuneVideo')
  241. [void] $listBox.Items.Add('*EclipseManager*')
  242. [void] $listBox.Items.Add('*ActiproSoftwareLLC*')
  243. [void] $listBox.Items.Add('*AdobeSystemsIncorporated.AdobePhotoshopExpress*')
  244. [void] $listBox.Items.Add('*Duolingo-LearnLanguagesforFree*')
  245. [void] $listBox.Items.Add('*PandoraMediaInc*')
  246. [void] $listBox.Items.Add('*CandyCrush*')
  247. [void] $listBox.Items.Add('*Wunderlist*')
  248. [void] $listBox.Items.Add('*Flipboard*')
  249. [void] $listBox.Items.Add('*Twitter*')
  250. [void] $listBox.Items.Add('*Facebook*')
  251. [void] $listBox.Items.Add('*Spotify*')
  252. [void] $listBox.Items.Add('*Minecraft*')
  253. [void] $listBox.Items.Add('*Royal Revolt*')
  254. [void] $listBox.Items.Add('*Sway*')
  255. [void] $listBox.Items.Add('*Speed Test*')
  256. [void] $listBox.Items.Add('*Dolby*')
  257. [void] $listBox.Items.Add('*Windows.CBSPreview*')
  258. [void] $listBox.Items.Add('*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*')
  259. [void] $listBox.Items.Add('*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*')
  260. [void] $listBox.Items.Add('*Microsoft.BingWeather*')
  261. [void] $listBox.Items.Add('*Microsoft.MSPaint*')
  262. [void] $listBox.Items.Add('*Microsoft.MicrosoftStickyNotes*')
  263. [void] $listBox.Items.Add('*Microsoft.Windows.Photos*')
  264. [void] $listBox.Items.Add('*Microsoft.WindowsCalculator*')
  265. [void] $listBox.Items.Add('*Microsoft.WindowsStore*')
  266. $form.Controls.Add($listBox)
  267. $form.Topmost = $true
  268. $result = $form.ShowDialog()
  269. if ($result -eq [System.Windows.Forms.DialogResult]::OK)
  270. {
  271. $x = $listBox.SelectedItems
  272. foreach ($x in $x) {
  273. Get-AppxPackage -Name $x| Remove-AppxPackage
  274. Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $x | Remove-AppxProvisionedPackage -Online
  275. Write-Verbose "Trying to remove $x."
  276. }
  277. }