-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeclutter.ps1
More file actions
312 lines (253 loc) · 13.9 KB
/
declutter.ps1
File metadata and controls
312 lines (253 loc) · 13.9 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
#Requires -RunAsAdministrator
<#
.SYNOPSIS
Windows 11 Declutter & Performance Script
.DESCRIPTION
Disables Copilot, Widgets, ads, suggestions, telemetry, Game Bar,
and other distractions. Optimizes for maximum performance.
Creates a restore point before making changes.
#>
Write-Host "`n=== Windows 11 Declutter & Performance Script ===" -ForegroundColor Cyan
Write-Host "Creating system restore point first...`n" -ForegroundColor Yellow
# --- 0. RESTORE POINT ---
try {
Enable-ComputerRestore -Drive "C:\" -ErrorAction SilentlyContinue
Checkpoint-Computer -Description "Pre-Declutter-$(Get-Date -Format 'yyyyMMdd-HHmm')" -RestorePointType MODIFY_SETTINGS -ErrorAction Stop
Write-Host "[OK] Restore point created" -ForegroundColor Green
} catch {
Write-Host "[WARN] Could not create restore point: $($_.Exception.Message)" -ForegroundColor Yellow
}
# Helper to set registry values, creating parent keys as needed
function Set-Reg {
param([string]$Path, [string]$Name, [int]$Value, [string]$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. DISABLE COPILOT
# ============================================================
Write-Host "`n--- Disabling Copilot ---" -ForegroundColor Cyan
# Policy: Turn off Windows Copilot
Set-Reg "HKCU:\Software\Policies\Microsoft\Windows\WindowsCopilot" "TurnOffWindowsCopilot" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" "TurnOffWindowsCopilot" 1
# Remove Copilot app (24H2+)
Get-AppxPackage -AllUsers -Name "Microsoft.Copilot" -ErrorAction SilentlyContinue | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName -like "*Microsoft.Copilot*" } |
Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
# Remove Microsoft 365 Copilot shortcut app
Get-AppxPackage -AllUsers -Name "Microsoft.Microsoft365Copilot" -ErrorAction SilentlyContinue | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
Write-Host "[OK] Copilot disabled & removed" -ForegroundColor Green
# ============================================================
# 2. DISABLE WIDGETS
# ============================================================
Write-Host "`n--- Disabling Widgets ---" -ForegroundColor Cyan
# Remove Widgets (Web Experience Pack)
Get-AppxPackage -AllUsers -Name "MicrosoftWindows.Client.WebExperience" -ErrorAction SilentlyContinue | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName -like "*WebExperience*" } |
Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
# Disable via taskbar policy
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Dsh" "AllowNewsAndInterests" 0
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarDa" 0
Write-Host "[OK] Widgets disabled & removed" -ForegroundColor Green
# ============================================================
# 3. DISABLE START MENU ADS & SUGGESTIONS
# ============================================================
Write-Host "`n--- Disabling Start Menu ads & suggestions ---" -ForegroundColor Cyan
$cdm = "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
# Disable suggested apps in Start
Set-Reg $cdm "SubscribedContent-338389Enabled" 0
# Disable suggestions occasionally in Start
Set-Reg $cdm "SubscribedContent-310093Enabled" 0
# Disable tips on lock screen
Set-Reg $cdm "SubscribedContent-338388Enabled" 0
# Disable suggested content in Settings
Set-Reg $cdm "SubscribedContent-338393Enabled" 0
Set-Reg $cdm "SubscribedContent-353694Enabled" 0
Set-Reg $cdm "SubscribedContent-353696Enabled" 0
# Disable pre-installed app suggestions
Set-Reg $cdm "OemPreInstalledAppsEnabled" 0
Set-Reg $cdm "PreInstalledAppsEnabled" 0
Set-Reg $cdm "PreInstalledAppsEverEnabled" 0
# Disable silent app installs
Set-Reg $cdm "SilentInstalledAppsEnabled" 0
# Disable software suggestions
Set-Reg $cdm "SoftLandingEnabled" 0
# Disable spotlight suggestions
Set-Reg $cdm "SystemPaneSuggestionsEnabled" 0
# Disable content suggestions
Set-Reg $cdm "ContentDeliveryAllowed" 0
# Disable Start Menu tips/recommendations (Iris)
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Start_IrisRecommendations" 0
# Disable recent items tracking
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Start_TrackDocs" 0
# Hide Recommended section (Pro/Enterprise)
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer" "HideRecommendedSection" 1
Write-Host "[OK] Start menu ads & suggestions disabled" -ForegroundColor Green
# ============================================================
# 4. DISABLE ADVERTISING ID & TAILORED EXPERIENCES
# ============================================================
Write-Host "`n--- Disabling advertising & tailored experiences ---" -ForegroundColor Cyan
# Disable advertising ID
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" "Enabled" 0
# Disable tailored experiences
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Privacy" "TailoredExperiencesWithDiagnosticDataEnabled" 0
# Disable app launch tracking
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Start_TrackProgs" 0
Write-Host "[OK] Advertising & tailored experiences disabled" -ForegroundColor Green
# ============================================================
# 5. DISABLE SEARCH HIGHLIGHTS & BING IN START
# ============================================================
Write-Host "`n--- Disabling search highlights & Bing ---" -ForegroundColor Cyan
# Disable search highlights
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\SearchSettings" "IsDynamicSearchBoxEnabled" 0
# Disable Bing web search in Start
Set-Reg "HKCU:\Software\Policies\Microsoft\Windows\Explorer" "DisableSearchBoxSuggestions" 1
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" "BingSearchEnabled" 0
Write-Host "[OK] Search highlights & Bing disabled" -ForegroundColor Green
# ============================================================
# 6. DISABLE TELEMETRY
# ============================================================
Write-Host "`n--- Disabling telemetry ---" -ForegroundColor Cyan
# Set telemetry to Security level (minimum)
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0
Set-Reg "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" "AllowTelemetry" 0
# Disable feedback notifications
Set-Reg "HKCU:\Software\Microsoft\Siuf\Rules" "NumberOfSIUFInPeriod" 0
# Disable telemetry services
$telemetryServices = @("DiagTrack", "dmwappushservice")
foreach ($svc in $telemetryServices) {
Stop-Service -Name $svc -Force -ErrorAction SilentlyContinue
Set-Service -Name $svc -StartupType Disabled -ErrorAction SilentlyContinue
}
# Disable telemetry scheduled tasks
$telemetryTasks = @(
"\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser",
"\Microsoft\Windows\Application Experience\ProgramDataUpdater",
"\Microsoft\Windows\Customer Experience Improvement Program\Consolidator",
"\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip"
)
foreach ($task in $telemetryTasks) {
schtasks /Change /TN $task /Disable 2>$null | Out-Null
}
Write-Host "[OK] Telemetry disabled" -ForegroundColor Green
# ============================================================
# 7. DISABLE TIPS & SUGGESTION NOTIFICATIONS
# ============================================================
Write-Host "`n--- Disabling tips & suggestion notifications ---" -ForegroundColor Cyan
# "Get tips and suggestions when using Windows"
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-338387Enabled" 0
# "Suggest ways to get the most out of Windows"
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement" "ScoobeSystemSettingEnabled" 0
# "Show me the Windows welcome experience"
Set-Reg $cdm "SubscribedContent-310094Enabled" 0
# "Get fun facts, tips, and more on your lock screen"
Set-Reg $cdm "RotatingLockScreenEnabled" 0
Set-Reg $cdm "RotatingLockScreenOverlayEnabled" 0
Write-Host "[OK] Tips & suggestion notifications disabled" -ForegroundColor Green
# ============================================================
# 8. DISABLE GAME BAR & XBOX SERVICES
# ============================================================
Write-Host "`n--- Disabling Game Bar & Xbox services ---" -ForegroundColor Cyan
# Disable Game Bar
Set-Reg "HKCU:\Software\Microsoft\GameBar" "AutoGameModeEnabled" 0
Set-Reg "HKCU:\System\GameConfigStore" "GameDVR_Enabled" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" "AllowGameDVR" 0
# Disable Xbox services
$xboxServices = @("XblAuthManager", "XblGameSave", "XboxNetApiSvc", "XboxGipSvc")
foreach ($svc in $xboxServices) {
Stop-Service -Name $svc -Force -ErrorAction SilentlyContinue
Set-Service -Name $svc -StartupType Disabled -ErrorAction SilentlyContinue
}
# Remove Xbox Game Bar app (optional - comment out if you need it)
Get-AppxPackage -AllUsers *XboxGamingOverlay* -ErrorAction SilentlyContinue | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
Write-Host "[OK] Game Bar & Xbox services disabled" -ForegroundColor Green
# ============================================================
# 9. REMOVE BLOATWARE APPS
# ============================================================
Write-Host "`n--- Removing bloatware apps ---" -ForegroundColor Cyan
$bloatApps = @(
"Microsoft.BingNews",
"Microsoft.BingWeather",
"Microsoft.BingFinance",
"Microsoft.BingSports",
"Microsoft.GetHelp",
"Microsoft.Getstarted",
"Microsoft.MicrosoftSolitaireCollection",
"Microsoft.People",
"Microsoft.PowerAutomateDesktop",
"Microsoft.Todos",
"Microsoft.WindowsFeedbackHub",
"Microsoft.WindowsMaps",
"Microsoft.ZuneMusic",
"Microsoft.ZuneVideo",
"Clipchamp.Clipchamp",
"Microsoft.MicrosoftOfficeHub",
"Microsoft.SkypeApp",
"Microsoft.WindowsCommunicationsApps",
"Microsoft.YourPhone",
"MicrosoftTeams",
"Microsoft.549981C3F5F10" # Cortana
)
foreach ($app in $bloatApps) {
Get-AppxPackage -AllUsers -Name $app -ErrorAction SilentlyContinue | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName -eq $app } |
Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
}
Write-Host "[OK] Bloatware apps removed" -ForegroundColor Green
# ============================================================
# 10. TASKBAR CLEANUP
# ============================================================
Write-Host "`n--- Cleaning up taskbar ---" -ForegroundColor Cyan
$taskbarPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
# Hide Task View button
Set-Reg $taskbarPath "ShowTaskViewButton" 0
# Hide Chat icon (Teams)
Set-Reg $taskbarPath "TaskbarMn" 0
# Hide Widgets button
Set-Reg $taskbarPath "TaskbarDa" 0
# Hide Search to icon only (1=icon, 0=hidden, 2=box)
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" "SearchboxTaskbarMode" 1
# Disable Copilot button
Set-Reg $taskbarPath "ShowCopilotButton" 0
Write-Host "[OK] Taskbar cleaned up" -ForegroundColor Green
# ============================================================
# 11. VISUAL PERFORMANCE OPTIMIZATIONS
# ============================================================
Write-Host "`n--- Applying performance optimizations ---" -ForegroundColor Cyan
# Set visual effects to "Adjust for best performance" (with font smoothing kept)
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" "VisualFXSetting" 2
# Keep font smoothing enabled for readability
Set-Reg "HKCU:\Control Panel\Desktop" "FontSmoothing" 2
# Disable transparency effects
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" "EnableTransparency" 0
# Disable animation effects
Set-Reg "HKCU:\Control Panel\Desktop\WindowMetrics" "MinAnimate" 0
# Disable Retail Demo service
Stop-Service -Name "RetailDemo" -Force -ErrorAction SilentlyContinue
Set-Service -Name "RetailDemo" -StartupType Disabled -ErrorAction SilentlyContinue
Write-Host "[OK] Performance optimizations applied" -ForegroundColor Green
# ============================================================
# 12. DISABLE LOCK SCREEN ADS / SPOTLIGHT
# ============================================================
Write-Host "`n--- Disabling lock screen ads ---" -ForegroundColor Cyan
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "RotatingLockScreenEnabled" 0
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "RotatingLockScreenOverlayEnabled" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsSpotlightFeatures" 1
Write-Host "[OK] Lock screen ads disabled" -ForegroundColor Green
# ============================================================
# 13. DISABLE ACTIVITY HISTORY
# ============================================================
Write-Host "`n--- Disabling activity history ---" -ForegroundColor Cyan
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" "EnableActivityFeed" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" "PublishUserActivities" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" "UploadUserActivities" 0
Write-Host "[OK] Activity history disabled" -ForegroundColor Green
# ============================================================
# DONE
# ============================================================
Write-Host "`n=== All Done! ===" -ForegroundColor Green
Write-Host "Please restart your computer for all changes to take effect." -ForegroundColor Yellow
Write-Host "A restore point was created - you can revert via System Restore if needed.`n" -ForegroundColor Yellow