From ef0bf8d492501049b6360ecf1d81b2339880ef65 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 22 Feb 2018 11:22:52 +0100 Subject: [PATCH 1/3] Reworked Onedrive uninstaller --- cleanW10.ps1 | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) mode change 100644 => 100755 cleanW10.ps1 diff --git a/cleanW10.ps1 b/cleanW10.ps1 old mode 100644 new mode 100755 index bad88e3..7e12121 --- a/cleanW10.ps1 +++ b/cleanW10.ps1 @@ -183,6 +183,22 @@ function disable_shitty_service ([string]$name){ } } +# Kill a process +# Param : +# $process : name of process to kill (String) +function kill_shitty_process { + param([string]$process) + Write-Host -ForegroundColor white -NoNewLine "`tKilling $process : " + try { + $p = Get-Process $process + Stop-Process $p | Out-Null + Write-Host -ForegroundColor Green "Done" + } + catch { + Write-host -ForegroundColor Yellow "Not started" + } +} + Write-Output "`nI's time to kick ass and chew bubble gum" Write-Output "________________________________________`n" @@ -201,10 +217,11 @@ foreach ($line in Get-Content "lib\tasks.txt") {remove_shitty_tasks $line } #Remove all OneDrive Stuff thanks to https://github.com/W4RH4WK/Debloat-Windows-10/ Write-Host -ForegroundColor white "Removing all Onedrive stuff :" -Write-Host -ForegroundColor white -NoNewLine "`tKilling explorer ans OneDrive : " -taskkill.exe /F /IM "OneDrive.exe" -taskkill.exe /F /IM "explorer.exe" -Write-Host -ForegroundColor Green "Done" + +# Kill onedrive qnd explorer for proper uninstallation +kill_shitty_process "onedrive" +kill_shitty_process "explorer" + Write-Host -ForegroundColor White "`tUninstalling Onedrive" if (Test-Path "$env:systemroot\System32\OneDriveSetup.exe") { & "$env:systemroot\System32\OneDriveSetup.exe" /uninstall @@ -215,15 +232,18 @@ if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") { Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:systemdrive\OneDriveTemp" + Write-Host -ForegroundColor White "`tModify OneDrive shitty registery values :" #OneDrive modify_shitty_reg_value "HKLM:\Software\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1 modify_shitty_reg_value "HKLM:\Software\Policies\Microsoft\Windows\OneDrive" "DisableFileSync" 1 modify_shitty_reg_value "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" "OneDrive" "0300000021B9DEB396D7D001" "Binary" # Onedrive Explorer integration +New-PSDrive -PSProvider Registry -Root HKEY_CLASSES_ROOT -Name HKCR | Out-Null modify_shitty_reg_value "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 modify_shitty_reg_value "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 - +Remove-PSDrive -Name HKCR +Start-Process "explorer.exe" #Advertiging... modify_shitty_reg_value "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\AdvertisingInfo" "Enabled" "0" From e72b3347d74ea2f732953ec9e1718aabfe97f6f5 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 22 Feb 2018 11:42:06 +0100 Subject: [PATCH 2/3] Add Twitter modern app --- lib/apps.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/apps.txt b/lib/apps.txt index 08a269a..3fc0758 100755 --- a/lib/apps.txt +++ b/lib/apps.txt @@ -1,4 +1,3 @@ -king.com.CandyCrushSodaSaga Microsoft.3dbuilder Microsoft.Appconnector Microsoft.BingFinance @@ -21,7 +20,7 @@ Microsoft.MinecraftUWP Microsoft.MSPaint Microsoft.Office.OneNote Microsoft.Office.Sway -Microsoft.OneConnec +Microsoft.OneConnect Microsoft.People Microsoft.Services.Store.Engagement Microsoft.SkypeApp @@ -39,4 +38,5 @@ Microsoft.XboxApp Microsoft.ZuneMusic Microsoft.ZuneVideo Microsoft.Advertising.Xaml -twitter \ No newline at end of file +9E2F88E3.Twitter +king.com.CandyCrushSodaSaga From 539c0aeae394b771c04b9ab4d8a477287fc06c15 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 22 Feb 2018 12:16:21 +0100 Subject: [PATCH 3/3] Better output for registery modifications --- cleanW10.ps1 | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/cleanW10.ps1 b/cleanW10.ps1 index 7e12121..47e7a9b 100755 --- a/cleanW10.ps1 +++ b/cleanW10.ps1 @@ -87,9 +87,9 @@ function remove_shitty_tasks () { # value : The value to write function modify_shitty_reg_value { param([string]$path, [string]$key, [string]$value, [string]$type) - Write-Host -ForegroundColor white -NoNewline "Modify $key reg value to $value : " + Write-Host -NoNewline "`t$key reg key to $value : " if (!(Test-Path $path)){ - Write-Host -ForegroundColor Gray -NoNewline "creating path - " + Write-Host -ForegroundColor Gray -NoNewline "creating path " New-Item -Path $path -Force | Out-Null } @@ -107,7 +107,7 @@ function modify_shitty_reg_value { } catch { Write-Host -ForegroundColor Red "error" - Write-Host $Error[0] + Write-Host "`t$Error[0]" return } Write-host -ForegroundColor Green "done" @@ -246,45 +246,47 @@ Remove-PSDrive -Name HKCR Start-Process "explorer.exe" #Advertiging... +Write-Host -ForegroundColor White "Disable Advertising :" modify_shitty_reg_value "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\AdvertisingInfo" "Enabled" "0" modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" "DisabledByGroupPolicy" 1 # Geoloc. +Write-Host -ForegroundColor White "Disable Geolocalization :" modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" "DisableLocation" 1 modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" "DisableLocationScripting" 1 modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" "DisableWindowsLocationProvider" 1 #smartscreen filter +Write-Host -ForegroundColor White "Disable Smartscreen filter :" modify_shitty_reg_value "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" "EnableWebContentEvaluation" # AllowTelemetry +Write-Host -ForegroundColor White "Disable Telemetry :" modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0 +Write-Host -ForegroundColor White "Modify somes Windows defendenr behaviors :" # Windows Defender Delivery Optimization Download modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" "DODownloadMode" "0" - -# WifiSense Credential Share -modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseCredShared" "0" - -# WifiSense Open-ness -modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseOpen" "0" - -# Windows Defender Spynet -modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SpynetReporting" 0 - -# Windows Defender Sample Submission -modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SubmitSamplesConsent" 2 - # Windows Defender Behavior monitoring and Spynet reporting. modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" "DisableBehaviorMonitoring" 1 modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SpynetReporting" 0 modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SubmitSamplesConsent" 2 + +Write-Host -ForegroundColor White "Disable Wifi-Sense :" +# WifiSense Credential Share +modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseCredShared" "0" +# WifiSense Open-ness +modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseOpen" "0" + + # Disable Cortana +Write-Host -ForegroundColor White "Disable Cortana (online at least) :" modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" "AllowCortana" "0" modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" "ConnectedSearchUseWeb" "0" # App right. +Write-Host -ForegroundColor White "Disable rights for applications :" modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsAccessAccountInfo" 2 modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsAccessCalendar" 2 modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsAccessCallHistory" 2 @@ -300,9 +302,11 @@ modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" " modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsSyncWithDevices" 2 # MS Account +Write-Host -ForegroundColor White "Disable MS online account for login :" modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" "NoConnectedUser" 3 # App suggestion (Cloud Content) +Write-Host -ForegroundColor White "Disable suggestions :" modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" "DisableWindowsConsumerFeatures" 1 Write-Host "all done!"