Skip to content

Commit bc19ace

Browse files
author
Raven
committed
Fix scripts for non-English locales
1 parent 72fcaf2 commit bc19ace

3 files changed

Lines changed: 119 additions & 27 deletions

File tree

build.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
2-
set FileVersion=1.0.0.7
3-
set ProductVersion=3.0.0.0
2+
set FileVersion=1.0.0.0
3+
set ProductVersion=2026.4.2.16
44
set "ROOT=%~dp0"
55
set "SCRIPT_BUNDLE_DIR=%ROOT%external_scripts"
66

@@ -10,7 +10,7 @@ mkdir "%SCRIPT_BUNDLE_DIR%"
1010
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
1111
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; " ^
1212
"$u1 = 'https://christitus.com/win'; " ^
13-
"$u2 = 'https://api.github.com/repos/Raphire/Win11Debloat/zipball/2026.03.09'; " ^
13+
"$u2 = 'https://api.github.com/repos/Raphire/Win11Debloat/zipball/2026.03.15'; " ^
1414
"$o1 = Join-Path '%SCRIPT_BUNDLE_DIR%' 'winutil.ps1'; " ^
1515
"$zip2 = Join-Path '%SCRIPT_BUNDLE_DIR%' 'win11debloat.zip'; " ^
1616
"Invoke-WebRequest -Uri $u1 -OutFile $o1 -UseBasicParsing; " ^

debloat_raven_scripts/edge_vanisher.ps1

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,49 @@ if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti
1111
exit 1
1212
}
1313

14+
$administratorsSid = "*S-1-5-32-544"
15+
16+
function Remove-ShortcutByTarget {
17+
param(
18+
[string[]]$SearchRoots,
19+
[string[]]$TargetPatterns
20+
)
21+
22+
$wshShell = $null
23+
try {
24+
$wshShell = New-Object -ComObject WScript.Shell
25+
}
26+
catch {
27+
return
28+
}
29+
30+
foreach ($root in $SearchRoots) {
31+
if (-not (Test-Path $root)) {
32+
continue
33+
}
34+
35+
Get-ChildItem -Path $root -Filter *.lnk -File -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
36+
try {
37+
$shortcut = $wshShell.CreateShortcut($_.FullName)
38+
$targetData = @(
39+
$shortcut.TargetPath,
40+
$shortcut.Arguments,
41+
$shortcut.IconLocation,
42+
$_.BaseName
43+
) -join ' '
44+
45+
foreach ($pattern in $TargetPatterns) {
46+
if ($targetData -like $pattern) {
47+
Remove-Item -Path $_.FullName -Force -ErrorAction SilentlyContinue
48+
break
49+
}
50+
}
51+
}
52+
catch {}
53+
}
54+
}
55+
}
56+
1457
$edgeInstaller = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Microsoft\Edge\Application\*\Installer\setup.exe" -ErrorAction SilentlyContinue | Select-Object -First 1
1558
if ($edgeInstaller) {
1659
Start-Process $edgeInstaller.FullName -ArgumentList "--uninstall --system-level --force-uninstall --verbose-logging" -Wait
@@ -21,19 +64,27 @@ Get-Process | Where-Object { $_.Name -like "*edge*" } | Stop-Process -Force -Err
2164
$pathsToRemove = @(
2265
"$env:LOCALAPPDATA\Microsoft\Edge",
2366
"${env:ProgramFiles(x86)}\Microsoft\Edge",
24-
"${env:ProgramFiles(x86)}\Microsoft\EdgeCore",
25-
"$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk",
26-
"$env:PUBLIC\Desktop\Microsoft Edge.lnk"
67+
"${env:ProgramFiles(x86)}\Microsoft\EdgeCore"
2768
)
2869

2970
foreach ($path in $pathsToRemove) {
3071
if (Test-Path $path) {
3172
takeown /F $path /R /D Y | Out-Null
32-
icacls $path /grant Administrators:F /T | Out-Null
73+
icacls $path /grant "${administratorsSid}:F" /T /C | Out-Null
3374
Remove-Item -Path $path -Recurse -Force -ErrorAction SilentlyContinue
3475
}
3576
}
3677

78+
Remove-ShortcutByTarget -SearchRoots @(
79+
"$env:ProgramData\Microsoft\Windows\Start Menu\Programs",
80+
"$env:APPDATA\Microsoft\Windows\Start Menu\Programs",
81+
"$env:PUBLIC\Desktop",
82+
[Environment]::GetFolderPath('Desktop')
83+
) -TargetPatterns @(
84+
"*msedge.exe*",
85+
"*Microsoft Edge*"
86+
)
87+
3788
$regKeys = @(
3889
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe",
3990
"HKLM:\SOFTWARE\Microsoft\Edge",

debloat_raven_scripts/uninstall_oo.ps1

Lines changed: 61 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,48 @@ if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti
1818
try {
1919
Set-ExecutionPolicy Bypass -Scope Process -Force
2020
$ErrorActionPreference = 'SilentlyContinue'
21+
$administratorsSid = "*S-1-5-32-544"
22+
23+
function Remove-ShortcutByTarget {
24+
param(
25+
[string[]]$SearchRoots,
26+
[string[]]$TargetPatterns
27+
)
28+
29+
$wshShell = $null
30+
try {
31+
$wshShell = New-Object -ComObject WScript.Shell
32+
}
33+
catch {
34+
return
35+
}
36+
37+
foreach ($root in $SearchRoots) {
38+
if (-not (Test-Path $root)) {
39+
continue
40+
}
41+
42+
Get-ChildItem -Path $root -Filter *.lnk -File -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
43+
try {
44+
$shortcut = $wshShell.CreateShortcut($_.FullName)
45+
$targetData = @(
46+
$shortcut.TargetPath,
47+
$shortcut.Arguments,
48+
$shortcut.IconLocation,
49+
$_.BaseName
50+
) -join ' '
51+
52+
foreach ($pattern in $TargetPatterns) {
53+
if ($targetData -like $pattern) {
54+
Remove-Item -Path $_.FullName -Force -ErrorAction SilentlyContinue
55+
break
56+
}
57+
}
58+
}
59+
catch {}
60+
}
61+
}
62+
}
2163

2264
# Close Outlook processes
2365
Get-Process | Where-Object { $_.ProcessName -like "*outlook*" } | Stop-Process -Force
@@ -35,26 +77,24 @@ try {
3577
foreach ($folder in $outlookFolders) {
3678
$folderPath = Join-Path $windowsAppsPath $folder.Name
3779
takeown /f $folderPath /r /d Y | Out-Null
38-
icacls $folderPath /grant administrators:F /t | Out-Null
80+
icacls $folderPath /grant "${administratorsSid}:F" /t /c | Out-Null
3981
Remove-Item -Path $folderPath -Recurse -Force
4082
}
4183

4284
# Remove shortcuts
43-
$shortcutPaths = @(
44-
"$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Outlook.lnk",
45-
"$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Outlook.lnk",
46-
"$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Outlook.lnk",
47-
"$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Outlook.lnk",
48-
"$env:PUBLIC\Desktop\Outlook.lnk",
49-
"$env:USERPROFILE\Desktop\Outlook.lnk",
50-
"$env:PUBLIC\Desktop\Microsoft Outlook.lnk",
51-
"$env:USERPROFILE\Desktop\Microsoft Outlook.lnk",
52-
"$env:PUBLIC\Desktop\Outlook (New).lnk",
53-
"$env:USERPROFILE\Desktop\Outlook (New).lnk",
54-
"$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Outlook (New).lnk",
55-
"$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Outlook (New).lnk"
85+
$shortcutRoots = @(
86+
"$env:ProgramData\Microsoft\Windows\Start Menu\Programs",
87+
"$env:APPDATA\Microsoft\Windows\Start Menu\Programs",
88+
"$env:PUBLIC\Desktop",
89+
[Environment]::GetFolderPath('Desktop')
90+
)
91+
92+
Remove-ShortcutByTarget -SearchRoots $shortcutRoots -TargetPatterns @(
93+
"*OUTLOOK.EXE*",
94+
"*Microsoft.Office.Outlook*",
95+
"*Microsoft.OutlookForWindows*",
96+
"*Outlook*"
5697
)
57-
$shortcutPaths | ForEach-Object { Remove-Item $_ -Force }
5898

5999
# Taskbar cleanup
60100
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Value 0 -Type DWord -Force
@@ -84,11 +124,12 @@ try {
84124
& "$env:SystemRoot\System32\OneDriveSetup.exe" /uninstall
85125
}
86126

127+
Remove-ShortcutByTarget -SearchRoots $shortcutRoots -TargetPatterns @(
128+
"*OneDrive.exe*",
129+
"*OneDrive*"
130+
)
131+
87132
@(
88-
"$env:ProgramData\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk",
89-
"$env:APPDATA\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk",
90-
"$env:PUBLIC\Desktop\OneDrive.lnk",
91-
"$env:USERPROFILE\Desktop\OneDrive.lnk",
92133
"$env:USERPROFILE\OneDrive",
93134
"$env:LOCALAPPDATA\Microsoft\OneDrive",
94135
"$env:ProgramData\Microsoft\OneDrive",
@@ -107,4 +148,4 @@ try {
107148
Start-Process explorer
108149
}
109150
catch {}
110-
exit
151+
exit

0 commit comments

Comments
 (0)