-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.ps1
More file actions
195 lines (161 loc) · 7.55 KB
/
script.ps1
File metadata and controls
195 lines (161 loc) · 7.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# FloriDevs W11Fixer
# Windows 11 Optimization Script
# Run as Administrator
$ErrorActionPreference = "Continue"
$Host.UI.RawUI.WindowTitle = "FloriDevs W11Fixer"
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " FloriDevs W11Fixer v1.0" -ForegroundColor Cyan
Write-Host " Windows 11 Optimization Script" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# Check for Administrator privileges
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Host "ERROR: This script requires Administrator privileges!" -ForegroundColor Red
Write-Host "Please right-click and select 'Run as Administrator'" -ForegroundColor Yellow
pause
exit
}
# Function to create registry key if it doesn't exist
function Set-RegistryValue {
param($Path, $Name, $Value, $Type = "DWord")
if (!(Test-Path $Path)) {
New-Item -Path $Path -Force | Out-Null
}
Set-ItemProperty -Path $Path -Name $Name -Value $Value -Type $Type -Force
}
# ======================================
# 1. REDUCE TELEMETRY & PRIVACY SETTINGS
# ======================================
Write-Host "[1/6] Reducing telemetry and improving privacy..." -ForegroundColor Green
# Disable telemetry
Set-RegistryValue "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0
Set-RegistryValue "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" "AllowTelemetry" 0
# Disable activity history
Set-RegistryValue "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" "EnableActivityFeed" 0
Set-RegistryValue "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" "PublishUserActivities" 0
# Disable advertising ID
Set-RegistryValue "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" "Enabled" 0
# Disable location tracking
Set-RegistryValue "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" "DisableLocation" 1
# Disable feedback requests
Set-RegistryValue "HKCU:\Software\Microsoft\Siuf\Rules" "NumberOfSIUFInPeriod" 0
# Disable Windows tips
Set-RegistryValue "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-338389Enabled" 0
Write-Host " Privacy settings configured!" -ForegroundColor Gray
# ======================================
# 2. TASKBAR TO LEFT
# ======================================
Write-Host "[2/6] Moving taskbar icons to the left..." -ForegroundColor Green
Set-RegistryValue "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarAl" 0
Write-Host " Taskbar aligned to left!" -ForegroundColor Gray
# ======================================
# 3. RESTORE CLASSIC CONTEXT MENU
# ======================================
Write-Host "[3/6] Restoring classic context menu..." -ForegroundColor Green
# Remove the Windows 11 context menu handler
reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
Write-Host " Classic context menu restored!" -ForegroundColor Gray
# ======================================
# 4. REMOVE BLOATWARE
# ======================================
Write-Host "[4/6] Removing bloatware apps..." -ForegroundColor Green
$bloatware = @(
"Microsoft.BingNews",
"Microsoft.BingWeather",
"Microsoft.GamingApp",
"Microsoft.GetHelp",
"Microsoft.Getstarted",
"Microsoft.MicrosoftOfficeHub",
"Microsoft.MicrosoftSolitaireCollection",
"Microsoft.People",
"Microsoft.PowerAutomateDesktop",
"Microsoft.Todos",
"Microsoft.WindowsAlarms",
"Microsoft.WindowsFeedbackHub",
"Microsoft.WindowsMaps",
"Microsoft.Xbox.TCUI",
"Microsoft.XboxGameOverlay",
"Microsoft.XboxGamingOverlay",
"Microsoft.XboxIdentityProvider",
"Microsoft.XboxSpeechToTextOverlay",
"Microsoft.ZuneMusic",
"Microsoft.ZuneVideo",
"MicrosoftTeams",
"Clipchamp.Clipchamp",
"*TikTok*",
"*Facebook*",
"*Instagram*",
"*Spotify*",
"*Disney*"
)
foreach ($app in $bloatware) {
Write-Host " Removing $app..." -ForegroundColor Gray -NoNewline
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $app | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
Write-Host " Done" -ForegroundColor Green
}
Write-Host " Bloatware removed!" -ForegroundColor Gray
# ======================================
# 5. INSTALL FIREFOX (if not present)
# ======================================
Write-Host "[5/6] Checking for Firefox..." -ForegroundColor Green
$firefoxPath = "C:\Program Files\Mozilla Firefox\firefox.exe"
if (!(Test-Path $firefoxPath)) {
Write-Host " Firefox not found. Downloading and installing..." -ForegroundColor Yellow
$firefoxInstaller = "$env:TEMP\firefox_installer.exe"
try {
Invoke-WebRequest -Uri "https://download.mozilla.org/?product=firefox-latest&os=win64&lang=en-US" -OutFile $firefoxInstaller
Start-Process -FilePath $firefoxInstaller -Args "/S" -Wait
Remove-Item $firefoxInstaller -Force
Write-Host " Firefox installed successfully!" -ForegroundColor Green
} catch {
Write-Host " Failed to install Firefox. Please install manually." -ForegroundColor Red
}
} else {
Write-Host " Firefox already installed!" -ForegroundColor Gray
}
# ======================================
# 6. DISABLE EDGE (Cannot fully remove)
# ======================================
Write-Host "[6/6] Disabling Microsoft Edge..." -ForegroundColor Green
# Prevent Edge from running in background
Set-RegistryValue "HKLM:\SOFTWARE\Policies\Microsoft\Edge" "BackgroundModeEnabled" 0
# Disable Edge startup boost
Set-RegistryValue "HKLM:\SOFTWARE\Policies\Microsoft\Edge" "StartupBoostEnabled" 0
# Remove Edge desktop shortcut
$edgeShortcut = "$env:PUBLIC\Desktop\Microsoft Edge.lnk"
if (Test-Path $edgeShortcut) {
Remove-Item $edgeShortcut -Force
}
# Disable Edge prelaunch
Set-RegistryValue "HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main" "AllowPrelaunch" 0
# Disable Edge tab preloading
Set-RegistryValue "HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\TabPreloader" "AllowTabPreloading" 0
Write-Host " Edge disabled (Note: Complete removal requires third-party tools)" -ForegroundColor Gray
# ======================================
# COMPLETION
# ======================================
Write-Host ""
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " Optimization Complete!" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Changes applied:" -ForegroundColor Yellow
Write-Host " [✓] Privacy settings optimized" -ForegroundColor Green
Write-Host " [✓] Taskbar moved to left" -ForegroundColor Green
Write-Host " [✓] Classic context menu restored" -ForegroundColor Green
Write-Host " [✓] Bloatware removed" -ForegroundColor Green
Write-Host " [✓] Firefox installed/verified" -ForegroundColor Green
Write-Host " [✓] Edge disabled" -ForegroundColor Green
Write-Host ""
Write-Host "IMPORTANT: Please restart your computer for all changes to take effect!" -ForegroundColor Yellow
Write-Host ""
$restart = Read-Host "Would you like to restart now? (Y/N)"
if ($restart -eq "Y" -or $restart -eq "y") {
Write-Host "Restarting in 10 seconds..." -ForegroundColor Yellow
Start-Sleep -Seconds 10
Restart-Computer -Force
} else {
Write-Host "Please restart manually when ready." -ForegroundColor Yellow
pause
}