From 1c9cef0079fd1ca3f0fdf45a3b65021dc203c884 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Tue, 6 Aug 2024 15:32:21 +0000 Subject: [PATCH 01/21] =?UTF-8?q?Deploying=20to=20main=20from=20@=20ChrisT?= =?UTF-8?q?itusTech/winutil@49100e1dd6a141a04c9ca84465b8a8e438bdda2e=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cfc8ee69..359ea51c 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you have Issues, refer to [Known Issues](https://christitustech.github.io/win These are the sponsors that help keep this project alive with monthly contributions. -Gregory NavasarkianYusuke SaitoTriHyderaMark AmosJason A. DiegmuellerwyattJan WilleOwenStefanthaddlPaulDave JonesAnthony Mendez +Gregory NavasarkianYusuke SaitoTriHyderaMark AmosJason A. DiegmuellerwyattOwenStefanthaddlPaulDave JonesAnthony Mendez ## 🏅 Thanks to all Contributors Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻. From de8a79df22928244e9caf71a98717132240b454e Mon Sep 17 00:00:00 2001 From: ClumsyLulz <86472964+SleepTheGod@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:01:46 -0400 Subject: [PATCH 02/21] Pull Request (#2526) * Update edgeremoval.ps1 * Update edgeremoval.ps1 * Update edgeremoval.ps1 --- edgeremoval.ps1 | 386 +++++++++++++++++++----------------------------- 1 file changed, 148 insertions(+), 238 deletions(-) diff --git a/edgeremoval.ps1 b/edgeremoval.ps1 index 5f3a7a3c..f2bc89af 100644 --- a/edgeremoval.ps1 +++ b/edgeremoval.ps1 @@ -1,195 +1,28 @@ # Script Metadata # Created by AveYo, source: https://raw.githubusercontent.com/AveYo/fox/main/Edge_Removal.bat -# Powershell Conversion and Refactor done by Chris Titus Tech - -# Initial Configuration -$host.ui.RawUI.WindowTitle = 'Edge Removal - Chris Titus Tech 2023.05.10' -$remove_win32 = @("Microsoft Edge", "Microsoft Edge Update") -$remove_appx = @("MicrosoftEdge") -$skip = @() # Optional: @("DevTools") - -$also_remove_webview = 0 -if ($also_remove_webview -eq 1) { - $remove_win32 += "Microsoft EdgeWebView" - $remove_appx += "WebExperience", "Win32WebViewHost" -} - -# Administrative Privileges Check -$privileges = @( - 'SeSecurityPrivilege', - 'SeTakeOwnershipPrivilege', - 'SeBackupPrivilege', - 'SeRestorePrivilege' -) - -foreach ($privilege in $privileges) { - [System.Diagnostics.Process]::SetPrivilege($privilege, 2) -} - -# Edge Removal Procedures -$processesToShutdown = @( - 'explorer', 'Widgets', 'widgetservice', 'msedgewebview2', 'MicrosoftEdge*', 'chredge', - 'msedge', 'edge', 'msteams', 'msfamily', 'WebViewHost', 'Clipchamp' -) - -Stop-Process -Name "explorer" -Force -ErrorAction SilentlyContinue -$processesToShutdown | ForEach-Object { - Stop-Process -Name $_ -Force -ErrorAction SilentlyContinue -} - -$MS = ($env:ProgramFiles, ${env:ProgramFiles(x86)})[[Environment]::Is64BitOperatingSystem] + '\Microsoft\Edge\Application\msedge.exe' - -Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe" -Recurse -ErrorAction SilentlyContinue -Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ie_to_edge_stub.exe" -Recurse -ErrorAction SilentlyContinue -Remove-Item -Path 'Registry::HKEY_Users\S-1-5-21*\Software\Classes\microsoft-edge' -Recurse -ErrorAction SilentlyContinue -Remove-Item -Path 'Registry::HKEY_Users\S-1-5-21*\Software\Classes\MSEdgeHTM' -Recurse -ErrorAction SilentlyContinue - -New-Item -Path "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" -Force -ErrorAction SilentlyContinue -Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" -Name '(Default)' -Value "`"$MS`" --single-argument %%1" -Force -ErrorAction SilentlyContinue - -New-Item -Path "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" -Force -ErrorAction SilentlyContinue -Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" -Name '(Default)' -Value "`"$MS`" --single-argument %%1" -Force -ErrorAction SilentlyContinue - -$registryPaths = @('HKLM:\SOFTWARE\Policies', 'HKLM:\SOFTWARE', 'HKLM:\SOFTWARE\WOW6432Node') -$edgeProperties = @('InstallDefault', 'Install{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}', 'Install{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}') -foreach ($path in $registryPaths) { - foreach ($prop in $edgeProperties) { - Remove-ItemProperty -Path "$path\Microsoft\EdgeUpdate" -Name $prop -Force -ErrorAction SilentlyContinue - } -} - -$edgeupdate = 'Microsoft\EdgeUpdate\Clients\{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}' -$webvupdate = 'Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}' -$on_actions = @('on-os-upgrade', 'on-logon', 'on-logon-autolaunch', 'on-logon-startup-boost') -$registryBases = @('HKLM:\SOFTWARE', 'HKLM:\SOFTWARE\Wow6432Node') -foreach ($base in $registryBases) { - foreach ($launch in $on_actions) { - Remove-Item -Path "$base\$edgeupdate\Commands\$launch" -Force -ErrorAction SilentlyContinue - Remove-Item -Path "$base\$webvupdate\Commands\$launch" -Force -ErrorAction SilentlyContinue - } -} - -$registryPaths = @('HKCU:', 'HKLM:') -$nodes = @('', '\Wow6432Node') -foreach ($regPath in $registryPaths) { - foreach ($node in $nodes) { - foreach ($i in $remove_win32) { - Remove-ItemProperty -Path "$regPath\SOFTWARE${node}\Microsoft\Windows\CurrentVersion\Uninstall\$i" -Name 'NoRemove' -Force -ErrorAction SilentlyContinue - New-Item -Path "$regPath\SOFTWARE${node}\Microsoft\EdgeUpdateDev" -Force | Out-Null - Set-ItemProperty -Path "$regPath\SOFTWARE${node}\Microsoft\EdgeUpdateDev" -Name 'AllowUninstall' -Value 1 -Type Dword -Force - } - } -} - -$foldersToSearch = @('LocalApplicationData', 'ProgramFilesX86', 'ProgramFiles') | ForEach-Object { - [Environment]::GetFolderPath($_) -} - -$edges = @() -$bhoFiles = @() - -foreach ($folder in $foldersToSearch) { - $bhoFiles += Get-ChildItem -Path "$folder\Microsoft\Edge*\ie_to_edge_stub.exe" -Recurse -ErrorAction SilentlyContinue - - $edges += Get-ChildItem -Path "$folder\Microsoft\Edge*\setup.exe" -Recurse -ErrorAction SilentlyContinue | - Where-Object { $_.FullName -notlike '*EdgeWebView*' } -} - -$destinationDir = "$env:SystemDrive\Scripts" -New-Item -Path $destinationDir -ItemType Directory -ErrorAction SilentlyContinue | Out-Null - -foreach ($bhoFile in $bhoFiles) { - if (Test-Path $bhoFile) { - try { - Copy-Item -Path $bhoFile -Destination "$destinationDir\ie_to_edge_stub.exe" -Force - } catch { } - } -} - -## Work on Appx Removals -$provisioned = Get-AppxProvisionedPackage -Online -$appxpackage = Get-AppxPackage -AllUsers -$eol = @() - -$store = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Store' -$storeP = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Store\InstalledApplications' -foreach ($app in $appxpackage) { - $name = $app.Name - if ($app.Name -eq "Microsoft.Edge") { - $eol += $name - } elseif ($app.Name -eq "Microsoft.EdgeBeta" -or $app.Name -eq "Microsoft.EdgeDev" -or $app.Name -eq "Microsoft.EdgeCanary" -or $app.Name -eq "Microsoft.MicrosoftEdge") { - $eol += $name - } -} - -$eolApps = $provisioned | Where-Object { $eol -contains $_.DisplayName } - -foreach ($edge in $eolApps) { - $edgeName = $edge.DisplayName - if (-not ($skip -contains $edgeName)) { - try { - Remove-AppxProvisionedPackage -Online -PackageName $edgeName -ErrorAction SilentlyContinue - } catch { } - } -} - -foreach ($edge in $appxpackage) { - $edgeName = $edge.Name - if ($eol -contains $edgeName) { - if (-not ($skip -contains $edgeName)) { - try { - Remove-AppxPackage -Package $edgeName -AllUsers -ErrorAction SilentlyContinue - } catch { } - } - } -} - -## Redirect shortcuts -$shortcut_path = "$env:Public\Desktop" -$shortcut_file = 'Microsoft Edge.lnk' -$full_path = Join-Path -Path $shortcut_path -ChildPath $shortcut_file - -if (Test-Path $full_path) { - Remove-Item -Path $full_path -Force -ErrorAction SilentlyContinue -} - -$shortcut_path = "$env:ProgramData\Microsoft\Windows\Start Menu\Programs" -$shortcut_file = 'Microsoft Edge.lnk' -$full_path = Join-Path -Path $shortcut_path -ChildPath $shortcut_file - -if (Test-Path $full_path) { - Remove-Item -Path $full_path -Force -ErrorAction SilentlyContinue -} - -$edgePolicy = 'HKLM:\SOFTWARE\Policies\Microsoft\Edge' -if (-not (Test-Path $edgePolicy)) { - New-Item -Path $edgePolicy -Force | Out-Null -} - -$edgePrefs = @{ - 'Dword' = @{ - 'BrowserReplacementEnabled' = 1 - 'HideFirstRunExperience' = 1 - 'HideImportEdgeFavoritesPrompt' = 1 - 'HideSyncSetupExperience' = 1 - 'FavoritesBarVisibility' = 1 - } - 'String' = @{ - 'AutoplayAllowed' = 'AllowOnce' - } -} - -foreach ($entryType in $edgePrefs.Keys) { - foreach ($prefName in $edgePrefs[$entryType].Keys) { - Set-ItemProperty -Path $edgePolicy -Name $prefName -Value $edgePrefs[$entryType][$prefName] -Type $entryType -Force - } -} - -# Output Results -Write-Host "Edge Removal Complete" -ForegroundColor Green +# Powershell Conversion and Refactor by Chris Titus Tech +# Updated By Taylor Christian Nesome 8/6/2024 # Define constants and initial configuration -$ScriptVersion = "2023.05.10" +<# +.SYNOPSIS + This script removes Microsoft Edge and related components from the system. + +.DESCRIPTION + This script performs the following tasks: + - Terminates Edge-related processes. + - Removes registry entries associated with Microsoft Edge. + - Uninstalls Edge-related AppX packages. + - Cleans up shortcut files. + - Configures Edge policy settings to prevent reinstallation. + +.NOTES + Updated by Taylor Christian Newsome + Version: 2024.08.06 +#> + +# Define constants and initial configuration +$ScriptVersion = "2024.08.06" $EdgeProcessesToShutdown = @('explorer', 'Widgets', 'widgetservice', 'msedgewebview2', 'MicrosoftEdge*', 'chredge', 'msedge', 'edge', 'msteams', 'msfamily', 'WebViewHost', 'Clipchamp') $EdgeRemovalOptions = @{ RemoveWin32 = @("Microsoft Edge", "Microsoft Edge Update") @@ -198,56 +31,133 @@ $EdgeRemovalOptions = @{ AlsoRemoveWebView = $false } -# Define main function to remove Microsoft Edge components -function Remove-MicrosoftEdge { - [CmdletBinding()] - param() - - # Function to shutdown processes related to Microsoft Edge - function Stop-EdgeProcesses { - $EdgeProcessesToShutdown | ForEach-Object { - Stop-Process -Name $_ -Force -ErrorAction SilentlyContinue - } - } - - # Function to remove registry entries related to Microsoft Edge - function Remove-EdgeRegistryEntries { - # Clean up certain registry entries - Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe" -Recurse -ErrorAction SilentlyContinue - Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ie_to_edge_stub.exe" -Recurse -ErrorAction SilentlyContinue - Remove-Item -Path 'Registry::HKEY_Users\S-1-5-21*\Software\Classes\microsoft-edge' -Recurse -ErrorAction SilentlyContinue - Remove-Item -Path 'Registry::HKEY_Users\S-1-5-21*\Software\Classes\MSEdgeHTM' -Recurse -ErrorAction SilentlyContinue - - # Create new registry entries - $EdgeExecutablePath = ($env:ProgramFiles, ${env:ProgramFiles(x86)})[[Environment]::Is64BitOperatingSystem] + '\Microsoft\Edge\Application\msedge.exe' - New-Item -Path "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" -Force -ErrorAction SilentlyContinue - Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" -Name '(Default)' -Value "`"$EdgeExecutablePath`" --single-argument %%1" -Force -ErrorAction SilentlyContinue - - New-Item -Path "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" -Force -ErrorAction SilentlyContinue - Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" -Name '(Default)' -Value "`"$EdgeExecutablePath`" --single-argument %%1" -Force -ErrorAction SilentlyContinue - } - - # Function to remove Microsoft Edge AppX packages - function Remove-EdgeAppxPackages { - $EdgeRemovalOptions.RemoveAppx | ForEach-Object { - # Remove provisioned packages - Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like "*$_*" -and $EdgeRemovalOptions.Skip -notcontains $_.PackageName } | Remove-AppxProvisionedPackage -Online -AllUsers -ErrorAction SilentlyContinue - - # Remove installed packages - Get-AppxPackage -AllUsers | Where-Object { $_.PackageFullName -like "*$_*" -and $EdgeRemovalOptions.Skip -notcontains $_.PackageFullName } | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue - } - } - - # Function to remove Microsoft Edge processes, registry entries, and AppX packages - try { - Stop-EdgeProcesses - Remove-EdgeRegistryEntries - Remove-EdgeAppxPackages - Write-Output "Microsoft Edge components have been successfully removed." - } catch { - Write-Error "Failed to remove Microsoft Edge components: $_" +# Function to check if the script is running with administrative privileges +function Test-Admin { + if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Error "The script must be run as an Administrator." + exit 1 } } -# Execute the main function -Remove-MicrosoftEdge \ No newline at end of file +# Function to stop Edge-related processes +function Stop-EdgeProcesses { + param([string[]]$ProcessesToStop) + foreach ($process in $ProcessesToStop) { + try { + Stop-Process -Name $process -Force -ErrorAction Stop + Write-Output "Successfully stopped process: $process" + } catch { + Write-Error "Failed to stop process: $process. $_" + } + } +} + +# Function to remove registry entries related to Microsoft Edge +function Remove-EdgeRegistryEntries { + param([string[]]$RegistryPaths) + foreach ($path in $RegistryPaths) { + try { + Remove-Item -Path $path -Recurse -Force -ErrorAction Stop + Write-Output "Successfully removed registry path: $path" + } catch { + Write-Error "Failed to remove registry path: $path. $_" + } + } +} + +# Function to remove Microsoft Edge AppX packages +function Remove-EdgeAppxPackages { + param([string[]]$AppxPackagesToRemove) + $provisionedPackages = Get-AppxProvisionedPackage -Online + foreach ($package in $AppxPackagesToRemove) { + try { + $packagesToRemove = $provisionedPackages | Where-Object { $_.DisplayName -like "*$package*" } + foreach ($pkg in $packagesToRemove) { + Remove-AppxProvisionedPackage -Online -PackageName $pkg.PackageName -ErrorAction Stop + Write-Output "Successfully removed provisioned package: $pkg.DisplayName" + } + + $installedPackages = Get-AppxPackage -AllUsers | Where-Object { $_.PackageFullName -like "*$package*" } + foreach ($pkg in $installedPackages) { + Remove-AppxPackage -Package $pkg.PackageFullName -AllUsers -ErrorAction Stop + Write-Output "Successfully removed installed package: $pkg.PackageFullName" + } + } catch { + Write-Error "Failed to remove AppX package: $package. $_" + } + } +} + +# Function to remove shortcuts related to Microsoft Edge +function Remove-EdgeShortcuts { + param([string[]]$ShortcutPaths) + foreach ($path in $ShortcutPaths) { + if (Test-Path $path) { + try { + Remove-Item -Path $path -Force -ErrorAction Stop + Write-Output "Successfully removed shortcut: $path" + } catch { + Write-Error "Failed to remove shortcut: $path. $_" + } + } + } +} + +# Function to configure Edge policy settings +function Configure-EdgePolicy { + param([hashtable]$PolicySettings) + $edgePolicyPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Edge' + if (-not (Test-Path $edgePolicyPath)) { + try { + New-Item -Path $edgePolicyPath -Force | Out-Null + Write-Output "Created Edge policy registry path: $edgePolicyPath" + } catch { + Write-Error "Failed to create Edge policy registry path: $edgePolicyPath. $_" + } + } + + foreach ($entryType in $PolicySettings.Keys) { + foreach ($prefName in $PolicySettings[$entryType].Keys) { + try { + Set-ItemProperty -Path $edgePolicyPath -Name $prefName -Value $PolicySettings[$entryType][$prefName] -Type $entryType -Force + Write-Output "Successfully set Edge policy: $prefName = $($PolicySettings[$entryType][$prefName])" + } catch { + Write-Error "Failed to set Edge policy: $prefName. $_" + } + } + } +} + +# Main execution +try { + Test-Admin + Stop-EdgeProcesses -ProcessesToStop $EdgeProcessesToShutdown + Remove-EdgeRegistryEntries -RegistryPaths @( + "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe", + "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ie_to_edge_stub.exe", + "Registry::HKEY_Users\S-1-5-21*\Software\Classes\microsoft-edge", + "Registry::HKEY_Users\S-1-5-21*\Software\Classes\MSEdgeHTM" + ) + Remove-EdgeAppxPackages -AppxPackagesToRemove $EdgeRemovalOptions.RemoveAppx + Remove-EdgeShortcuts -ShortcutPaths @( + "$env:Public\Desktop\Microsoft Edge.lnk", + "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk" + ) + Configure-EdgePolicy -PolicySettings @{ + 'Dword' = @{ + 'BrowserReplacementEnabled' = 1 + 'HideFirstRunExperience' = 1 + 'HideImportEdgeFavoritesPrompt' = 1 + 'HideSyncSetupExperience' = 1 + 'FavoritesBarVisibility' = 1 + } + 'String' = @{ + 'AutoplayAllowed' = 'AllowOnce' + } + } + Write-Output "Microsoft Edge components have been successfully removed." +} catch { + Write-Error "An error occurred during execution: $_" +} + +Remove-MicrosoftEdge From 0bea5f8ceb8cb5ca88fe1c891510f62de5ae6931 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Tue, 6 Aug 2024 17:02:25 +0000 Subject: [PATCH 03/21] Compile Winutil --- winutil.ps1 | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 34269601..29ab4b31 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -8,7 +8,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 24.08.03 + Version : 24.08.06 #> param ( [switch]$Debug, @@ -45,7 +45,7 @@ Add-Type -AssemblyName System.Windows.Forms # Variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "24.08.03" +$sync.version = "24.08.06" $sync.configs = @{} $sync.ProcessRunning = $false @@ -15893,8 +15893,8 @@ Stop-Transcript # SIG # Begin signature block # MIIQRwYJKoZIhvcNAQcCoIIQODCCEDQCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG -# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCpr3PCAiIU+717 -# XjBk+klB20McRwzbj5pzZuVN6LMCqqCCDIMwggYaMIIEAqADAgECAhBiHW0MUgGe +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCcU2gQXIP8mYVL +# FIApc67vR3IMDb3vuZI4yUk9qWGC+qCCDIMwggYaMIIEAqADAgECAhBiHW0MUgGe # O5B5FSCJIRwKMA0GCSqGSIb3DQEBDAUAMFYxCzAJBgNVBAYTAkdCMRgwFgYDVQQK # Ew9TZWN0aWdvIExpbWl0ZWQxLTArBgNVBAMTJFNlY3RpZ28gUHVibGljIENvZGUg # U2lnbmluZyBSb290IFI0NjAeFw0yMTAzMjIwMDAwMDBaFw0zNjAzMjEyMzU5NTla @@ -15966,16 +15966,16 @@ Stop-Transcript # ZSBTaWduaW5nIENBIFIzNgIQJs052f8oQtNfSG2ygwabxTANBglghkgBZQMEAgEF # AKCBhDAYBgorBgEEAYI3AgEMMQowCKACgAChAoAAMBkGCSqGSIb3DQEJAzEMBgor # BgEEAYI3AgEEMBwGCisGAQQBgjcCAQsxDjAMBgorBgEEAYI3AgEVMC8GCSqGSIb3 -# DQEJBDEiBCBksIhprWGO//zFcDUtab07MIdidY5PBTZLCjP4yEt1nTANBgkqhkiG -# 9w0BAQEFAASCAgCEDYnFHtAMbkhtCzhKM8Ic2zNdo44on8+MfFSbBBfE87X+II12 -# XkSr/L/bbErIRmOCTf3QYQ+EmbRxv9q0i9p5UWos54kp81xga1lSE6riab9++tMS -# a6kp+4z9JrPb0T0I5efJfmoF7hS/ydkzupyvxGjq6Xq59Oj4c2/fqBEOFNssTiru -# QM2dusKgYUfCw2iThpbF+UyPtZRU3xh+ycRW2HNOMHdaBa92CY3SyzubGRKgz3qp -# X5WBY+8VqMJaAIlY4ZrhMMEzVul+QytL75ms8fg0CT1unkyawRGhpb/FyqBQBsS3 -# ORDe3TyROZ6jvGNb3qLJy1TH9VfPRx8XzTmFBlNrZAGs86BpVPtHfgaChza5AIv3 -# IywTr4qgBux4Q2MXY5dBMEahGZn9edtF0FLkj/yV0US3fPgAQ2vMnXsStW+GmXs9 -# wxj1WKEIGhzYfMmuiuW8Jr3rAABIZBx1F4HM3+0vsBXsGg/ZLf17wNTB/UC8iePX -# YVOB0KrO1GkzZzrZXGdmYNYbxlEJNRaVVcXj9jTU+zFEUWKN90xO3IErGVQBprnQ -# t3Y00j3gnI08K0tuvg+7QwFPNi3gn7DZ4LBX0n4LZvD9cvMar3VS4TEHqAPkPqkG -# BgRSLMjIbSeQnLJfIBe2/1GJwKqpM8NPthc2rsBxzmKFqRc7vqNT9ROFzw== +# DQEJBDEiBCAvzjz0wYtwWAYz9f7Rlsj+9xbvfrLyqG2EUlH59/EXujANBgkqhkiG +# 9w0BAQEFAASCAgCU6Y2zq0dTXWMjpgBhkX1lHW1e9TG/p+qG6ISUFhqH+0A6hw4W +# 7p1290/ORf+7usw8T956JPvAqZKS+Tk58Mfh5PtIuHRfEwjcoNOWmGvUVe2fP6BD +# tl9oznLOYtj3ItA5UpirNoTJFwe7DXQYIqdvGpbw3/PnZliva4zbP++BN0KLtf8F +# vR+xOA5Gi3CEJbkUQgE7tlR11CKxkUFuD5NuwF52FA5zztQmZSaH/C4tmdnPhbz7 +# b+dyt+9lrstUlPB/VpF+XP5V4PEuHfcLbmCXPuIWhhva1pVZe6iiMGNZc7gECb6G +# l47In2bvAS0YNf/qLK11EhFDjanXa9G6vqs8OAa6Py8gC07ZQF7mmeQd0/qZCxvX +# /uj3mfwBUbKBeY8gw7SFTjzZfL9asUjg/C2vsNMdWisPRgs0kw0cXRm+mze2mL2s +# UVDZYDDKlQiAWrAhFY8kSWzxtkV3Jw+pxDj7OnUCCQ72a5Bog+iWsdNwbFXtcrqy +# xXZYmS+nT5lSOP2BazFcqe+BItXjoAu3lXhY4zqb0fXiRF/+Cn+0AFjpGabP/iL7 +# YtvPnyyFNpJrtgE0JlEsPhdLXta4F4tKXmnvzhSxiaSP2uVR1ykiuIiZLhFWJMZV +# BycA2VZigXE3Zlyfu3tD0lSDChTLUMkvTw7z+sLYkm/HgTSE949+3iPjcw== # SIG # End signature block From 33d5d55b15adf06b4680a724010c07e9f494c1f4 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Tue, 6 Aug 2024 12:38:35 -0500 Subject: [PATCH 04/21] Delete edgeremoval.ps1 This was destroyed and GPT trash. --- edgeremoval.ps1 | 163 ------------------------------------------------ 1 file changed, 163 deletions(-) delete mode 100644 edgeremoval.ps1 diff --git a/edgeremoval.ps1 b/edgeremoval.ps1 deleted file mode 100644 index f2bc89af..00000000 --- a/edgeremoval.ps1 +++ /dev/null @@ -1,163 +0,0 @@ -# Script Metadata -# Created by AveYo, source: https://raw.githubusercontent.com/AveYo/fox/main/Edge_Removal.bat -# Powershell Conversion and Refactor by Chris Titus Tech -# Updated By Taylor Christian Nesome 8/6/2024 - -# Define constants and initial configuration -<# -.SYNOPSIS - This script removes Microsoft Edge and related components from the system. - -.DESCRIPTION - This script performs the following tasks: - - Terminates Edge-related processes. - - Removes registry entries associated with Microsoft Edge. - - Uninstalls Edge-related AppX packages. - - Cleans up shortcut files. - - Configures Edge policy settings to prevent reinstallation. - -.NOTES - Updated by Taylor Christian Newsome - Version: 2024.08.06 -#> - -# Define constants and initial configuration -$ScriptVersion = "2024.08.06" -$EdgeProcessesToShutdown = @('explorer', 'Widgets', 'widgetservice', 'msedgewebview2', 'MicrosoftEdge*', 'chredge', 'msedge', 'edge', 'msteams', 'msfamily', 'WebViewHost', 'Clipchamp') -$EdgeRemovalOptions = @{ - RemoveWin32 = @("Microsoft Edge", "Microsoft Edge Update") - RemoveAppx = @("MicrosoftEdge") - Skip = @() # Optional: @("DevTools") - AlsoRemoveWebView = $false -} - -# Function to check if the script is running with administrative privileges -function Test-Admin { - if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { - Write-Error "The script must be run as an Administrator." - exit 1 - } -} - -# Function to stop Edge-related processes -function Stop-EdgeProcesses { - param([string[]]$ProcessesToStop) - foreach ($process in $ProcessesToStop) { - try { - Stop-Process -Name $process -Force -ErrorAction Stop - Write-Output "Successfully stopped process: $process" - } catch { - Write-Error "Failed to stop process: $process. $_" - } - } -} - -# Function to remove registry entries related to Microsoft Edge -function Remove-EdgeRegistryEntries { - param([string[]]$RegistryPaths) - foreach ($path in $RegistryPaths) { - try { - Remove-Item -Path $path -Recurse -Force -ErrorAction Stop - Write-Output "Successfully removed registry path: $path" - } catch { - Write-Error "Failed to remove registry path: $path. $_" - } - } -} - -# Function to remove Microsoft Edge AppX packages -function Remove-EdgeAppxPackages { - param([string[]]$AppxPackagesToRemove) - $provisionedPackages = Get-AppxProvisionedPackage -Online - foreach ($package in $AppxPackagesToRemove) { - try { - $packagesToRemove = $provisionedPackages | Where-Object { $_.DisplayName -like "*$package*" } - foreach ($pkg in $packagesToRemove) { - Remove-AppxProvisionedPackage -Online -PackageName $pkg.PackageName -ErrorAction Stop - Write-Output "Successfully removed provisioned package: $pkg.DisplayName" - } - - $installedPackages = Get-AppxPackage -AllUsers | Where-Object { $_.PackageFullName -like "*$package*" } - foreach ($pkg in $installedPackages) { - Remove-AppxPackage -Package $pkg.PackageFullName -AllUsers -ErrorAction Stop - Write-Output "Successfully removed installed package: $pkg.PackageFullName" - } - } catch { - Write-Error "Failed to remove AppX package: $package. $_" - } - } -} - -# Function to remove shortcuts related to Microsoft Edge -function Remove-EdgeShortcuts { - param([string[]]$ShortcutPaths) - foreach ($path in $ShortcutPaths) { - if (Test-Path $path) { - try { - Remove-Item -Path $path -Force -ErrorAction Stop - Write-Output "Successfully removed shortcut: $path" - } catch { - Write-Error "Failed to remove shortcut: $path. $_" - } - } - } -} - -# Function to configure Edge policy settings -function Configure-EdgePolicy { - param([hashtable]$PolicySettings) - $edgePolicyPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Edge' - if (-not (Test-Path $edgePolicyPath)) { - try { - New-Item -Path $edgePolicyPath -Force | Out-Null - Write-Output "Created Edge policy registry path: $edgePolicyPath" - } catch { - Write-Error "Failed to create Edge policy registry path: $edgePolicyPath. $_" - } - } - - foreach ($entryType in $PolicySettings.Keys) { - foreach ($prefName in $PolicySettings[$entryType].Keys) { - try { - Set-ItemProperty -Path $edgePolicyPath -Name $prefName -Value $PolicySettings[$entryType][$prefName] -Type $entryType -Force - Write-Output "Successfully set Edge policy: $prefName = $($PolicySettings[$entryType][$prefName])" - } catch { - Write-Error "Failed to set Edge policy: $prefName. $_" - } - } - } -} - -# Main execution -try { - Test-Admin - Stop-EdgeProcesses -ProcessesToStop $EdgeProcessesToShutdown - Remove-EdgeRegistryEntries -RegistryPaths @( - "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe", - "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ie_to_edge_stub.exe", - "Registry::HKEY_Users\S-1-5-21*\Software\Classes\microsoft-edge", - "Registry::HKEY_Users\S-1-5-21*\Software\Classes\MSEdgeHTM" - ) - Remove-EdgeAppxPackages -AppxPackagesToRemove $EdgeRemovalOptions.RemoveAppx - Remove-EdgeShortcuts -ShortcutPaths @( - "$env:Public\Desktop\Microsoft Edge.lnk", - "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk" - ) - Configure-EdgePolicy -PolicySettings @{ - 'Dword' = @{ - 'BrowserReplacementEnabled' = 1 - 'HideFirstRunExperience' = 1 - 'HideImportEdgeFavoritesPrompt' = 1 - 'HideSyncSetupExperience' = 1 - 'FavoritesBarVisibility' = 1 - } - 'String' = @{ - 'AutoplayAllowed' = 'AllowOnce' - } - } - Write-Output "Microsoft Edge components have been successfully removed." -} catch { - Write-Error "An error occurred during execution: $_" -} - -Remove-MicrosoftEdge From f3df13a4caeaf37f3d3ef1baf662c4dcf1927893 Mon Sep 17 00:00:00 2001 From: MyDrift Date: Tue, 6 Aug 2024 19:42:18 +0200 Subject: [PATCH 05/21] Debloat Edge Tweak (#2454) * create debloat edge tweak * removed changing privacy setting instead of auto decline geo,sensor... it asks the user if needed --- config/tweaks.json | 156 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/config/tweaks.json b/config/tweaks.json index f15bbf72..0aeec295 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -1580,6 +1580,162 @@ } ] }, + "WPFTweaksEdgeDebloat": { + "Content": "Debloat Edge", + "Description": "Disables various telemetry options, popups, and other annoyances in Edge.", + "category": "Essential Tweaks", + "panel": "1", + "Order": "a016_", + "registry": [ + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\EdgeUpdate", + "Name": "CreateDesktopShortcutDefault", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeEnhanceImagesEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "PersonalizationReportingEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "ShowRecommendationsEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "HideFirstRunExperience", + "Type": "DWord", + "Value": "1", + "OriginalValue": "0" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "UserFeedbackAllowed", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "ConfigureDoNotTrack", + "Type": "DWord", + "Value": "1", + "OriginalValue": "0" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "AlternateErrorPagesEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeCollectionsEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeFollowEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeShoppingAssistantEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "MicrosoftEdgeInsiderPromotionEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "PersonalizationReportingEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "ShowMicrosoftRewards", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "WebWidgetAllowed", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "DiagnosticData", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeAssetDeliveryServiceEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeCollectionsEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "CryptoWalletEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "ConfigureDoNotTrack", + "Type": "DWord", + "Value": "1", + "OriginalValue": "0" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "WalletDonationEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + } + ] + }, "WPFTweaksConsumerFeatures":{ "Content": "Disable ConsumerFeatures", "Description": "Windows 10 will not automatically install any games, third-party apps, or application links from the Windows Store for the signed-in user. Some default Apps will be inaccessible (eg. Phone Link)", From 2b01fb739fbdadd0568bcfe0dc325e211095b898 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Tue, 6 Aug 2024 17:42:49 +0000 Subject: [PATCH 06/21] Compile Winutil --- winutil.ps1 | 185 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 171 insertions(+), 14 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 29ab4b31..4c640f8c 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -10950,6 +10950,162 @@ $sync.configs.tweaks = '{ } ] }, + "WPFTweaksEdgeDebloat": { + "Content": "Debloat Edge", + "Description": "Disables various telemetry options, popups, and other annoyances in Edge.", + "category": "Essential Tweaks", + "panel": "1", + "Order": "a016_", + "registry": [ + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\EdgeUpdate", + "Name": "CreateDesktopShortcutDefault", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeEnhanceImagesEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "PersonalizationReportingEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "ShowRecommendationsEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "HideFirstRunExperience", + "Type": "DWord", + "Value": "1", + "OriginalValue": "0" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "UserFeedbackAllowed", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "ConfigureDoNotTrack", + "Type": "DWord", + "Value": "1", + "OriginalValue": "0" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "AlternateErrorPagesEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeCollectionsEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeFollowEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeShoppingAssistantEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "MicrosoftEdgeInsiderPromotionEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "PersonalizationReportingEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "ShowMicrosoftRewards", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "WebWidgetAllowed", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "DiagnosticData", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeAssetDeliveryServiceEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "EdgeCollectionsEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "CryptoWalletEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "ConfigureDoNotTrack", + "Type": "DWord", + "Value": "1", + "OriginalValue": "0" + }, + { + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", + "Name": "WalletDonationEnabled", + "Type": "DWord", + "Value": "0", + "OriginalValue": "1" + } + ] + }, "WPFTweaksConsumerFeatures": { "Content": "Disable ConsumerFeatures", "Description": "Windows 10 will not automatically install any games, third-party apps, or application links from the Windows Store for the signed-in user. Some default Apps will be inaccessible (eg. Phone Link)", @@ -14939,6 +15095,7 @@ $inputXML = ' + - +