megadeth9001

Untitled

Nov 3rd, 2017
1,516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #W10 Initial Load cleaner, # to keep programs
  2.  
  3. Function Start-Nobloat {
  4.      
  5.     $apps = @(
  6.    
  7.         "Microsoft.3DBuilder"
  8.         "Microsoft.Microsoft3DViewer"
  9.         "Microsoft.Appconnector"
  10.         "Microsoft.BingFinance"
  11.         "Microsoft.BingNews"
  12.         "Microsoft.BingSports"
  13.         "Microsoft.BingWeather"
  14.         "Microsoft.WindowsCamera"
  15.         #"Microsoft.FreshPaint"
  16.         "Microsoft.Getstarted"
  17.         "Microsoft.MicrosoftOfficeHub"
  18.         "Microsoft.MicrosoftSolitaireCollection"
  19.         "Microsoft.MicrosoftStickyNotes"
  20.         #"Microsoft.Office.OneNote"
  21.         "Microsoft.OneConnect"
  22.         "Microsoft.People"
  23.         "Microsoft.SkypeApp"
  24.         #"Microsoft.StorePurchaseApp"
  25.         #"Microsoft.Windows.Photos"
  26.         "Microsoft.WindowsAlarms"
  27.         #"Microsoft.WindowsCalculator"
  28.         "Microsoft.WindowsCamera"
  29.         #"Microsoft.Windows.Cortana"
  30.         "Microsoft.WindowsMaps"
  31.         "Microsoft.WindowsPhone"
  32.         "Microsoft.WindowsSoundRecorder"
  33.         #"Microsoft.WindowsStore"
  34.         "Microsoft.XboxApp"
  35.         "Microsoft.XboxGameOverlay"
  36.         "Microsoft.XboxSpeechToTextOverlay"
  37.         "Microsoft.XboxIdentityProvider"
  38.         "Microsoft.XboxGameXCallableUI"
  39.         "Microsoft.ZuneMusic"
  40.         "Microsoft.ZuneVideo"
  41.         "microsoft.windowscommunicationsapps"
  42.         "Microsoft.Wallet"
  43.         "Microsoft.MinecraftUWP"
  44.         "Microsoft.NetworkSpeedTest"
  45.         "Microsoft.PPIProjection"
  46.         #"Microsoft.MicrosoftEdge"
  47.         "Microsoft.MicrosoftPowerBIForWindows"
  48.         "AdobeSystemsIncorporated.AdobePhotoshopExpress"
  49.         "Microsoft.CommsPhone"
  50.         "Microsoft.ConnectivityStore"
  51.         "Microsoft.Messaging"
  52.         "Microsoft.Office.Sway"
  53.         "Microsoft.OneConnect"
  54.         "Microsoft.WindowsFeedbackHub"
  55.         "Microsoft.BingFoodAndDrink"
  56.         "Microsoft.BingTravel"
  57.         "Microsoft.BingHealthAndFitness"
  58.         "Microsoft.WindowsReadingList"
  59.         #"CortanaListenUIApp"
  60.         "Microsoft.MicrosoftSolitaiteCollection"
  61.         #"CortanaListenUIApp_10.0.15063.0_neutral__cw5n1h2txyewy"
  62.         "9E2F88E3.Twitter"
  63.         "PandoraMediaInc.29680B314EFC2"
  64.         "Flipboard.Flipboard"
  65.         "ShazamEntertainmentLtd.Shazam"
  66.         "king.com.CandyCrushSaga"
  67.         "king.com.CandyCrushSodaSaga"
  68.         "king.com.*"
  69.         "ClearChannelRadioDigital.iHeartRadio"
  70.         "4DF9E0F8.Netflix"
  71.         "6Wunderkinder.Wunderlist"
  72.         "Drawboard.DrawboardPDF"
  73.         "2FE3CB00.PicsArt-PhotoStudio"
  74.         "D52A8D61.FarmVille2CountryEscape"
  75.         "TuneIn.TuneInRadio"
  76.         "GAMELOFTSA.Asphalt8Airborne"
  77.         "TheNewYorkTimes.NYTCrossword"
  78.         "DB6EA5DB.CyberLinkMediaSuiteEssentials"
  79.         "Facebook.Facebook"
  80.         "flaregamesGmbH.RoyalRevolt2"
  81.         "Playtika.CaesarsSlotsFreeCasino"
  82.         "46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y"
  83.         "ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  84.         "AdobeSystemsIncorporated.AdobePhotoshopExpress_1.3.2.4_x64__ynb6jyjzte8ga"
  85.         "ActiproSoftwareLLC.562882FEEB491"
  86.         "Microsoft.MinecraftUWP"
  87.         "A278AB0D.MarchofEmpires"
  88.         "Microsoft.MicrosoftSolitairecollection"
  89.         "Microsoft.GetHelp"
  90.         "Microsoft.Windows.HolographicFirstRun"
  91.         "Microsoft.Advertising.Xaml"
  92.         "9E2F88E3.Twitter"
  93.         "king.com.CandyCrushSodaSaga"
  94.         "Facebook.Facebook"
  95.        
  96.        
  97.     )
  98.    
  99.     ForEach ($app in $apps) {
  100.         Write-Output "Trying to remove $app"
  101.    
  102.         Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage
  103.    
  104.         Get-AppXProvisionedPackage -Online |
  105.             Where-Object DisplayName -EQ $app |
  106.             Remove-AppxProvisionedPackage -Online
  107.     }
  108. }
  109.    
  110. Function Remove-Keys {
  111.  
  112.         #Creates a "drive" to access the HKCR (HKEY_CLASSES_ROOT)
  113.         New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
  114.    
  115.         $Keys = @(
  116.    
  117.             #Remove Background Tasks
  118.             "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y"
  119.             "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  120.             "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe"
  121.             "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
  122.             "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
  123.    
  124.             #Windows File
  125.             "HKCR:\Extensions\ContractId\Windows.File\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  126.    
  127.             #Registry keys to delete if they aren't uninstalled by RemoveAppXPackage/RemoveAppXProvisionedPackage
  128.             "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y"
  129.             "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  130.             "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
  131.             "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
  132.    
  133.             #Scheduled Tasks to delete
  134.             "HKCR:\Extensions\ContractId\Windows.PreInstalledConfigTask\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe"
  135.    
  136.             #Windows Protocol Keys
  137.             "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  138.             "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
  139.             "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
  140.        
  141.             #Windows Share Target
  142.             "HKCR:\Extensions\ContractId\Windows.ShareTarget\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  143.         )
  144.    
  145.         ForEach ($Key in $Keys) {
  146.             Write-Output "Removing $Key from registry"
  147.             Remove-Item $Key -Recurse
  148.         }
  149. }
  150.    
  151. Function Protect-Privacy {
  152.  
  153.     New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
  154.     Sleep 2
  155.    
  156.     #Disables Windows Feedback Experience
  157.     If (Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo') {
  158.         $Advertising = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo'
  159.         Set-ItemProperty $Advertising -Name Enabled -Value 0
  160.     }
  161.    
  162.     If (!('HKCU:\Software\Microsoft\Siuf\Rules\PeriodInNanoSeconds')) {
  163.         $Period = 'HKCU:\Software\Microsoft\Siuf\Rules\PeriodInNanoSeconds'
  164.         New-Item $Period
  165.         Set-ItemProperty -Name PeriodInNanoSeconds -Value 0
  166.     }
  167.            
  168.     Write-Output "Adding Registry key to prevent bloatware apps from returning"
  169.            
  170.     #Prevents bloatware applications from returning
  171.     If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content\")) {
  172.         $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content"
  173.         Mkdir $registryPath
  174.         New-ItemProperty $registryPath -Name DisableWindowsConsumerFeatures -Value 1
  175.     }
  176.            
  177.     Sleep 1
  178.            
  179.     Write-Output "Stopping Edge from taking over as the default .PDF viewer"
  180.            
  181.     If ('HKCR:\.pdf') {
  182.         #This is the .pdf file association string
  183.         $PDF = 'HKCR:\.pdf'
  184.         New-ItemProperty $PDF -Name NoOpenWith
  185.         New-ItemProperty $PDF -Name NoStaticDefaultVerb
  186.     }
  187.            
  188.     Sleep 1
  189.            
  190.     If ('HKCR:\.pdf\OpenWithProgids') {
  191.         #This is the .pdf file association string
  192.         $Progids = 'HKCR:\.pdf\OpenWithProgids'
  193.         New-ItemProperty $Progids -Name NoOpenWith
  194.         New-ItemProperty $Progids -Name NoStaticDefaultVerb
  195.     }
  196. }
  197. Function Revert-Changes {        
  198.  
  199.     Get-AppxPackage -AllUsers | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
  200.    
  201.     If (Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo') {
  202.         $Advertising = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo'
  203.         Set-ItemProperty $Advertising -Name Enabled -Value 1
  204.     }
  205.        
  206.     Write-Output "Adding Registry key to prevent bloatware apps from returning"
  207.        
  208.     #Prevents bloatware applications from returning
  209.     If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content\")) {
  210.         $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content"
  211.         Mkdir $registryPath
  212.         New-ItemProperty $registryPath -Name DisableWindowsConsumerFeatures -Value 1
  213.     }
  214.        
  215.     Sleep 1
  216.        
  217.     Write-Output "Stopping Edge from taking over as the default .PDF viewer"
  218.        
  219.     If ('HKCR:\.pdf') {
  220.         #This is the .pdf file association string
  221.         $PDF = 'HKCR:\.pdf'
  222.         New-ItemProperty $PDF -Name NoOpenWith
  223.         New-ItemProperty $PDF -Name NoStaticDefaultVerb
  224.     }
  225.        
  226.     Sleep 1
  227.        
  228.     If ('HKCR:\.pdf\OpenWithProgids') {
  229.         #This is the .pdf file association string
  230.         $Progids = 'HKCR:\.pdf\OpenWithProgids'
  231.         New-ItemProperty $Progids -Name NoOpenWith
  232.         New-ItemProperty $Progids -Name NoStaticDefaultVerb
  233.     }
  234.        
  235.     $env:Path = "C:\Windows10Debloater\Windows.BackgroundTasks\ActiproBackground.reg"
  236.     Start-Process $env:Path
  237.     $wshell = New-Object -ComObject wscript.shell;
  238.     $wshell.AppActivate('UAC')
  239.     Sleep 1
  240.     $wshell.SendKeys('~')
  241.     Sleep 1
  242.     $wshell = New-Object -ComObject wscript.shell;
  243.     $wshell.AppActivate('UAC')
  244.     Sleep 1
  245.     $wshell.SendKeys('~')
  246.  
  247.     $env:Path = "C:\Windows10Debloater\Windows.BackgroundTasks\PPIBackground.reg"
  248.     Start-Process $env:Path
  249.     $wshell = New-Object -ComObject wscript.shell;
  250.     $wshell.AppActivate('UAC')
  251.     Sleep 1
  252.     $wshell.SendKeys('~')
  253.     Sleep 1
  254.     $wshell = New-Object -ComObject wscript.shell;
  255.     $wshell.AppActivate('UAC')
  256.     Sleep 1
  257.     $wshell.SendKeys('~')
  258.  
  259.     $env:Path = "C:\Windows10Debloater\Windows.BackgroundTasks\XboxBackground.reg"
  260.     Start-Process $env:Path
  261.     $wshell = New-Object -ComObject wscript.shell;
  262.     $wshell.AppActivate('UAC')
  263.     Sleep 1
  264.     $wshell.SendKeys('~')
  265.     Sleep 1
  266.     $wshell = New-Object -ComObject wscript.shell;
  267.     $wshell.AppActivate('UAC')
  268.     Sleep 1
  269.     $wshell.SendKeys('~')
  270.  
  271.     $env:Path = "C:\Windows10Debloater\Windows.File\ActiproFile.reg"
  272.     Start-Process $env:Path
  273.     $wshell = New-Object -ComObject wscript.shell;
  274.     $wshell.AppActivate('UAC')
  275.     Sleep 1
  276.     $wshell.SendKeys('~')
  277.     Sleep 1
  278.     $wshell = New-Object -ComObject wscript.shell;
  279.     $wshell.AppActivate('UAC')
  280.     Sleep 1
  281.     $wshell.SendKeys('~')
  282.  
  283.     $env:Path = "C:\Windows10Debloater\Windows.Launch\ActiproLaunch.reg"
  284.     Start-Process $env:Path
  285.     $wshell = New-Object -ComObject wscript.shell;
  286.     $wshell.AppActivate('UAC')
  287.     Sleep 1
  288.     $wshell.SendKeys('~')
  289.     Sleep 1
  290.     $wshell = New-Object -ComObject wscript.shell;
  291.     $wshell.AppActivate('UAC')
  292.     Sleep 1
  293.     $wshell.SendKeys('~')
  294.  
  295.     $env:Path = "C:\Windows10Debloater\Windows.Launch\EclipseLaunch.reg"
  296.     Start-Process $env:Path
  297.     $wshell = New-Object -ComObject wscript.shell;
  298.     $wshell.AppActivate('UAC')
  299.     Sleep 1
  300.     $wshell.SendKeys('~')
  301.     Sleep 1
  302.     $wshell = New-Object -ComObject wscript.shell;
  303.     $wshell.AppActivate('UAC')
  304.     Sleep 1
  305.     $wshell.SendKeys('~')
  306.  
  307.     $env:Path = "C:\Windows10Debloater\Windows.Launch\PPILaunch.reg"
  308.     Start-Process $env:Path
  309.     $wshell = New-Object -ComObject wscript.shell;
  310.     $wshell.AppActivate('UAC')
  311.     Sleep 1
  312.     $wshell.SendKeys('~')
  313.     Sleep 1
  314.     $wshell = New-Object -ComObject wscript.shell;
  315.     $wshell.AppActivate('UAC')
  316.     Sleep 1
  317.     $wshell.SendKeys('~')
  318.  
  319.     $env:Path = "C:\Windows10Debloater\Windows.Launch\XboxLaunch.reg"
  320.     Start-Process $env:Path
  321.     $wshell = New-Object -ComObject wscript.shell;
  322.     $wshell.AppActivate('UAC')
  323.     Sleep 1
  324.     $wshell.SendKeys('~')
  325.     Sleep 1
  326.     $wshell = New-Object -ComObject wscript.shell;
  327.     $wshell.AppActivate('UAC')
  328.     Sleep 1
  329.     $wshell.SendKeys('~')
  330.  
  331.     $env:Path = "C:\Windows10Debloater\Windows.Protocol\ActiproProtocol.reg"
  332.     Start-Process $env:Path
  333.     $wshell = New-Object -ComObject wscript.shell;
  334.     $wshell.AppActivate('UAC')
  335.     Sleep 1
  336.     $wshell.SendKeys('~')
  337.     Sleep 1
  338.     $wshell = New-Object -ComObject wscript.shell;
  339.     $wshell.AppActivate('UAC')
  340.     Sleep 1
  341.     $wshell.SendKeys('~')
  342.  
  343.     $env:Path = "C:\Windows10Debloater\Windows.Protocol\PPIProtocol.reg"
  344.     Start-Process $env:Path
  345.     $wshell = New-Object -ComObject wscript.shell;
  346.     $wshell.AppActivate('UAC')
  347.     Sleep 1
  348.     $wshell.SendKeys('~')
  349.     Sleep 1
  350.     $wshell = New-Object -ComObject wscript.shell;
  351.     $wshell.AppActivate('UAC')
  352.     Sleep 1
  353.     $wshell.SendKeys('~')
  354.  
  355.     $env:Path = "C:\Windows10Debloater\Windows.Protocol\XboxProtocol.reg"
  356.     Start-Process $env:Path
  357.     $wshell = New-Object -ComObject wscript.shell;
  358.     $wshell.AppActivate('UAC')
  359.     Sleep 1
  360.     $wshell.SendKeys('~')
  361.     Sleep 1
  362.     $wshell = New-Object -ComObject wscript.shell;
  363.     $wshell.AppActivate('UAC')
  364.     Sleep 1
  365.     $wshell.SendKeys('~')
  366.  
  367.     $env:Path = "C:\Windows10Debloater\Windows.ShareTarget\ActiproShare.reg"
  368.     Start-Process $env:Path
  369.     $wshell = New-Object -ComObject wscript.shell;
  370.     $wshell.AppActivate('UAC')
  371.     Sleep 1
  372.     $wshell.SendKeys('~')
  373.     Sleep 1
  374.     $wshell = New-Object -ComObject wscript.shell;
  375.     $wshell.AppActivate('UAC')
  376.     Sleep 1
  377.     $wshell.SendKeys('~')
  378.  
  379. }
  380.  
  381. #Switch statement containing Yes/No options
  382. Write-Output "Do you want to continue this script?"
  383. $ReadHost = Read-Host " ( Yes / No ) "
  384. Switch ($ReadHost) {
  385.     Yes {Write-Output "Continuing..."; $PublishSettings = $true}
  386.     No {
  387.         Write-Output "Exiting script."; $PublishSettings = $false
  388.         Sleep 1
  389.         Exit
  390.     }
  391. }
  392.    
  393. #Switch statement containing Debloat/Revert options
  394. Write-Output "The following options will allow you to either Debloat Windows 10, or to revert changes made after Debloating Windows 10.
  395.    Choose 'Debloat' to Debloat Windows 10 or choose 'Revert' to revert changes."
  396. $Readhost = Read-Host " ( Debloat / Revert ) "
  397. Switch ($ReadHost) {
  398.     #This will debloat Windows 10
  399.     Nobloat {
  400.         Write-Output "Starting Debloat. Uninstalling bloatware"; $PublishSettings = $true
  401.         Start-Nobloat
  402.         Backup-Keys
  403.         Remove-Keys
  404.     }
  405.  
  406.     Revert {
  407.         Write-Output "Reverting changes..."; $PublishSettings = $false
  408.         Revert-Changes
  409.     }
  410. }
  411.    
  412. #Switch statement containing Yes/No options
  413. Write-Output "Do you want to change some privacy settings? This will disable Cortana from acting within your Search, and disable feedback to Microsoft, as well as stop
  414. Edge from being the default PDF viewer."
  415. $Readhost = Read-Host " ( Yes / No ) "
  416. Switch ($ReadHost) {
  417.     Yes {
  418.         Write-Output "Changing some system settings"; $PublishSettings = $true
  419.         Protect-Privacy
  420.     }
  421.     No {Write-Output "Skipping..."; $PublishSettings = $false}
  422. }
  423.  
  424. Write-Output "Script has finished. Exiting."
  425. Sleep 2
  426. Exit
Advertisement
Add Comment
Please, Sign In to add comment