forked from LeDragoX/Win-Debloat-Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptimize-privacy-and-performance.ps1
454 lines (369 loc) · 26.4 KB
/
optimize-privacy-and-performance.ps1
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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
# Adapted from these Baboo videos: https://youtu.be/qWESrvP_uU8
# Adapted from this AdamX's video REG scripts: https://youtu.be/hQSkPmZRCjc
# Adapted from this ChrisTitus script: https://github.com/ChrisTitusTech/win10script
# Adapted from this Sycnex script: https://github.com/Sycnex/Windows10Debloater
# Adapted from this kalaspuffar/Daniel Persson script: https://github.com/kalaspuffar/windows-debloat
function Optimize-PrivacyAndPerformance() {
Write-Title -Text "Privacy And Performance Tweaks"
Write-Section -Text "Personalization Section"
Write-Caption -Text "? & ? & Start & Lockscreen"
Write-Host "$($EnableStatus[0]) Show me the windows welcome experience after updates..."
Write-Host "$($EnableStatus[0]) 'Get fun facts and tips, etc. on lock screen'..."
$ContentDeliveryManagerDisableOnZero = @(
"SubscribedContent-310093Enabled"
"SubscribedContent-314559Enabled"
"SubscribedContent-314563Enabled"
"SubscribedContent-338387Enabled"
"SubscribedContent-338388Enabled"
"SubscribedContent-338389Enabled"
"SubscribedContent-338393Enabled"
"SubscribedContent-353698Enabled"
"RotatingLockScreenOverlayEnabled"
"RotatingLockScreenEnabled"
# Prevents Apps from re-installing
"ContentDeliveryAllowed"
"FeatureManagementEnabled"
"OemPreInstalledAppsEnabled"
"PreInstalledAppsEnabled"
"PreInstalledAppsEverEnabled"
"RemediationRequired"
"SilentInstalledAppsEnabled"
"SoftLandingEnabled"
"SubscribedContentEnabled"
"SystemPaneSuggestionsEnabled"
)
Write-Warning "[?][Priv&Perf] From Path: [$PathToCUContentDeliveryManager]."
ForEach ($Name in $ContentDeliveryManagerDisableOnZero) {
Write-Host "$($EnableStatus[0]) $($Name): $Zero."
Set-ItemProperty -Path "$PathToCUContentDeliveryManager" -Name "$Name" -Type DWord -Value $Zero
}
Write-Host "[-][Priv&Perf] Disabling 'Suggested Content in the Settings App'..."
If (Test-Path "$PathToCUContentDeliveryManager\Subscriptions") {
Remove-Item -Path "$PathToCUContentDeliveryManager\Subscriptions" -Recurse
}
Write-Host "$($EnableStatus[0]) 'Show Suggestions' in Start..."
If (Test-Path "$PathToCUContentDeliveryManager\SuggestedApps") {
Remove-Item -Path "$PathToCUContentDeliveryManager\SuggestedApps" -Recurse
}
Write-Section -Text "Privacy Section -> Windows Permissions"
Write-Caption -Text "General"
Write-Host "$($EnableStatus[0]) Let apps use my advertising ID..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value $Zero
If (!(Test-Path "$PathToLMPoliciesAdvertisingInfo")) {
New-Item -Path "$PathToLMPoliciesAdvertisingInfo" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesAdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value $One
Write-Host "$($EnableStatus[0]) 'Let websites provide locally relevant content by accessing my language list'..."
Set-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name "HttpAcceptLanguageOptOut" -Type DWord -Value $One
Write-Caption -Text "Speech"
# [@] (0 = Decline, 1 = Accept)
Write-Host "$($EnableStatus[0]) Online Speech Recognition..."
If (!(Test-Path "$PathToCUOnlineSpeech")) {
New-Item -Path "$PathToCUOnlineSpeech" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToCUOnlineSpeech" -Name "HasAccepted" -Type DWord -Value $Zero
Write-Caption -Text "Inking & Typing Personalization"
Set-ItemProperty -Path "$PathToCUInputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToCUInputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUInputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value $One
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value $Zero
Write-Caption -Text "Diagnostics & Feedback"
# [@] (0 = Security (Enterprise only), 1 = Basic Telemetry, 2 = Enhanced Telemetry, 3 = Full Telemetry)
Write-Host "$($EnableStatus[0]) telemetry..."
Set-ItemProperty -Path "$PathToLMPoliciesTelemetry" -Name "AllowTelemetry" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToLMPoliciesTelemetry2" -Name "AllowTelemetry" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToLMPoliciesTelemetry" -Name "AllowDeviceNameInTelemetry" -Type DWord -Value $Zero
Write-Host "$($EnableStatus[0]) send inking and typing data to Microsoft..."
If (!(Test-Path "$PathToCUInputTIPC")) {
New-Item -Path "$PathToCUInputTIPC" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToCUInputTIPC" -Name "Enabled" -Type DWord -Value $Zero
Write-Host "$($EnableStatus[0]) Tailored Experiences..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" -Name "TailoredExperiencesWithDiagnosticDataEnabled" -Type DWord -Value $Zero
Write-Host "$($EnableStatus[0]) View diagnostic data..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack\EventTranscriptKey" -Name "EnableEventTranscript" -Type DWord -Value $Zero
Write-Host "$($EnableStatus[0]) feedback frequency..."
If (!(Test-Path "$PathToCUSiufRules")) {
New-Item -Path "$PathToCUSiufRules" -Force | Out-Null
}
If ((Test-Path "$PathToCUSiufRules\PeriodInNanoSeconds")) {
Remove-ItemProperty -Path "$PathToCUSiufRules" -Name "PeriodInNanoSeconds"
}
Set-ItemProperty -Path "$PathToCUSiufRules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value $Zero
Write-Caption -Text "Activity History"
Write-Host "$($EnableStatus[0]) Activity History..."
$ActivityHistoryDisableOnZero = @(
"EnableActivityFeed"
"PublishUserActivities"
"UploadUserActivities"
)
Write-Warning "[?][Priv&Perf] From Path: [$PathToLMActivityHistory]."
ForEach ($Name in $ActivityHistoryDisableOnZero) {
Write-Host "$($EnableStatus[0]) $($Name): $Zero."
Set-ItemProperty -Path "$PathToLMActivityHistory" -Name "$ActivityHistoryDisableOnZero" -Type DWord -Value $Zero
}
Write-Section -Text "Privacy Section -> Apps Permissions"
Write-Caption -Text "Location"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Value "Deny"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Value "Deny"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value $Zero
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "EnableStatus" -Type DWord -Value $Zero
Write-Caption -Text "Notifications"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener" -Name "Value" -Value "Deny"
Write-Caption -Text "App Diagnostics"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics" -Name "Value" -Value "Deny"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics" -Name "Value" -Value "Deny"
Write-Caption -Text "Account Info Access"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" -Name "Value" -Value "Deny"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" -Name "Value" -Value "Deny"
Write-Caption -Text "Other Devices"
# Disable sharing information with unpaired devices
Write-Host "[-][Priv&Perf] Denying device access..."
If (!(Test-Path "$PathToCUDeviceAccessGlobal\LooselyCoupled")) {
New-Item -Path "$PathToCUDeviceAccessGlobal\LooselyCoupled" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToCUDeviceAccessGlobal\LooselyCoupled" -Name "Value" -Value "Deny"
ForEach ($key in (Get-ChildItem "$PathToCUDeviceAccessGlobal")) {
If ($key.PSChildName -EQ "LooselyCoupled") {
continue
}
Write-Host "$($EnableStatus[1]) Setting $($key.PSChildName) value to 'Deny'..."
Set-ItemProperty -Path ("$PathToCUDeviceAccessGlobal\" + $key.PSChildName) -Name "Value" -Value "Deny"
}
Write-Caption -Text "Background Apps"
Write-Host "$($EnableStatus[0]) Background Apps..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Name "GlobalUserDisabled" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUSearch" -Name "BackgroundAppGlobalToggle" -Type DWord -Value $Zero
Write-Section -Text "Update & Security Section"
Write-Caption -Text "Windows Update"
If (!(Test-Path "$PathToLMPoliciesWindowsUpdate")) {
New-Item -Path "$PathToLMPoliciesWindowsUpdate" -Force | Out-Null
}
# [@] (2 = Notify before download, 3 = Automatically download and notify of installation)
# [@] (4 = Automatically download and schedule installation, 5 = Automatic Updates is required and users can configure it)
Write-Host "[-][Priv&Perf] Disabling Automatic Download and Installation of Windows Updates..."
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "AUOptions" -Type DWord -Value 2
# [@] (0 = Enable Automatic Updates, 1 = Disable Automatic Updates)
Write-Host "$($EnableStatus[1]) Automatic Updates..."
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "NoAutoUpdate" -Type DWord -Value $Zero
# [@] (0 = Every day, 1~7 = The days of the week from Sunday (1) to Saturday (7) (Only valid if AUOptions = 4))
Write-Host "[+][Priv&Perf] Setting Scheduled Day to Every day..."
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "ScheduledInstallDay" -Type DWord -Value 0
# [@] (0-23 = The time of day in 24-hour format)
Write-Host "[-][Priv&Perf] Setting Scheduled time to 03h00m..."
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "ScheduledInstallTime" -Type DWord -Value 3
Write-Host "[=] Enabling automatic driver updates..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value 1
Write-Host "$($EnableStatus[1]) Change Windows Updates to 'Notify to schedule restart'..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value $One
# [@] (0 = Off, 1 = Local Network only, 2 = Local Network private peering only)
# [@] (3 = Local Network and Internet, 99 = Simply Download mode, 100 = Bypass mode)
Write-Host "$($EnableStatus[1]) Restricting Windows Update P2P downloads for Local Network only..."
If (!(Test-Path "$PathToLMDeliveryOptimizationCfg")) {
New-Item -Path "$PathToLMDeliveryOptimizationCfg" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMDeliveryOptimizationCfg" -Name "DODownloadMode" -Type DWord -Value $One
Write-Caption -Text "Troubleshooting"
Write-Host "[+][Priv&Perf] Enabling Automatic Recommended Troubleshooting, then notify me..."
if (!(Test-Path "$PathToLMWindowsTroubleshoot")) {
New-Item -Path "$PathToLMWindowsTroubleshoot" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMWindowsTroubleshoot" -Name "UserPreference" -Type DWord -Value 3
Write-Host "$($EnableStatus[0]) Windows Spotlight Features..."
Write-Host "$($EnableStatus[0]) Third Party Suggestions..."
Write-Host "$($EnableStatus[0]) More Telemetry Features..."
$CloudContentDisableOnOne = @(
"DisableWindowsSpotlightFeatures"
"DisableWindowsSpotlightOnActionCenter"
"DisableWindowsSpotlightOnSettings"
"DisableWindowsSpotlightWindowsWelcomeExperience"
"DisableTailoredExperiencesWithDiagnosticData" # Tailored Experiences
"DisableThirdPartySuggestions"
)
Write-Warning "[?][Priv&Perf] From Path: [$PathToCUPoliciesCloudContent]."
ForEach ($Name in $CloudContentDisableOnOne) {
Write-Host "$($EnableStatus[0]) $($Name): $One."
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "$Name" -Type DWord -Value $One
}
If (!(Test-Path "$PathToCUPoliciesCloudContent")) {
New-Item -Path "$PathToCUPoliciesCloudContent" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "ConfigureWindowsSpotlight" -Type DWord -Value 2
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "IncludeEnterpriseSpotlight" -Type DWord -Value $Zero
Write-Host "$($EnableStatus[0]) Apps Suggestions..."
If (!(Test-Path "$PathToLMPoliciesCloudContent")) {
New-Item -Path "$PathToLMPoliciesCloudContent" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesCloudContent" -Name "DisableThirdPartySuggestions" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToLMPoliciesCloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value $One
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -Type DWord -Value $One
If (!(Test-Path "$PathToLMPoliciesSQMClient")) {
New-Item -Path "$PathToLMPoliciesSQMClient" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesSQMClient" -Name "CEIPEnable" -Type DWord -Value $Zero
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" -Name "AITEnable" -Type DWord -Value $Zero
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" -Name "DisableUAR" -Type DWord -Value $One
# Details: https://docs.microsoft.com/pt-br/windows-server/remote/remote-desktop-services/rds-vdi-recommendations-2004#windows-system-startup-event-traces-autologgers
Write-Host "$($EnableStatus[0]) some startup event traces (AutoLoggers)..."
If (!(Test-Path "$PathToLMAutoLogger\AutoLogger-Diagtrack-Listener")) {
New-Item -Path "$PathToLMAutoLogger\AutoLogger-Diagtrack-Listener" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMAutoLogger\AutoLogger-Diagtrack-Listener" -Name "Start" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToLMAutoLogger\SQMLogger" -Name "Start" -Type DWord -Value $Zero
Write-Host "$($EnableStatus[0]) 'WiFi Sense: HotSpot Sharing'..."
If (!(Test-Path "$PathToLMPoliciesToWifi\AllowWiFiHotSpotReporting")) {
New-Item -Path "$PathToLMPoliciesToWifi\AllowWiFiHotSpotReporting" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesToWifi\AllowWiFiHotSpotReporting" -Name "value" -Type DWord -Value $Zero
Write-Host "$($EnableStatus[0]) 'WiFi Sense: Shared HotSpot Auto-Connect'..."
If (!(Test-Path "$PathToLMPoliciesToWifi\AllowAutoConnectToWiFiSenseHotspots")) {
New-Item -Path "$PathToLMPoliciesToWifi\AllowAutoConnectToWiFiSenseHotspots" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesToWifi\AllowAutoConnectToWiFiSenseHotspots" -Name "value" -Type DWord -Value $Zero
Write-Section -Text "Gaming Section"
Write-Host "[+][Priv&Perf] Enabling Game Bar & Game DVR..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\ApplicationManagement\AllowGameDVR" -Name "value" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name "AppCaptureEnabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value $One
If (!(Test-Path "$PathToLMPoliciesGameDVR")) {
New-Item -Path "$PathToLMPoliciesGameDVR" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesGameDVR" -Name "AllowGameDVR" -Type DWord -Value $One
Write-Host "$($EnableStatus[1]) game mode..."
Set-ItemProperty -Path "$PathToCUGameBar" -Name "AllowAutoGameMode" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUGameBar" -Name "AutoGameModeEnabled" -Type DWord -Value $One
Write-Section -Text "System Section"
Write-Caption -Text "Display"
Write-Host "[+][Priv&Perf] Enable Hardware Accelerated GPU Scheduling... (Windows 10 20H1+ - Needs Restart)"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name "HwSchMode" -Type DWord -Value 2
# Show Task Manager details - Applicable to 1607 and later - Although this functionality exist even in earlier versions, the Task Manager's behavior is different there and is not compatible with this tweak
Write-Host "$($EnableStatus[1]) Showing task manager details..."
$taskmgr = Start-Process -WindowStyle Hidden -FilePath taskmgr.exe -PassThru
Do {
Start-Sleep -Milliseconds 100
$preferences = Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -ErrorAction SilentlyContinue
} Until ($preferences)
Stop-Process $taskmgr
$preferences.Preferences[28] = 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -Type Binary -Value $preferences.Preferences
Write-Caption "Deleting useless registry keys..."
$KeysToDelete = @(
# Remove Background Tasks
"HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y"
"HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
"HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe"
"HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
"HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
"HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy"
# Windows File
"HKCR:\Extensions\ContractId\Windows.File\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
# Registry keys to delete if they aren't uninstalled by RemoveAppXPackage/RemoveAppXProvisionedPackage
"HKCR:\Extensions\ContractId\Windows.Launch\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y"
"HKCR:\Extensions\ContractId\Windows.Launch\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
"HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
"HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
"HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy"
# Scheduled Tasks to delete
"HKCR:\Extensions\ContractId\Windows.PreInstalledConfigTask\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe"
# Windows Protocol Keys
"HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
"HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
"HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
"HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy"
# Windows Share Target
"HKCR:\Extensions\ContractId\Windows.ShareTarget\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
)
ForEach ($Key in $KeysToDelete) {
If ((Test-Path $Key)) {
Write-Host "[Priv&Perf] Removing Key: [$Key]."
Remove-Item $Key -Recurse
}
}
Write-Title -Text "Performance Tweaks"
# As SysMain was already disabled on the Services, just need to remove it's key
# [@] (0 = Disable SysMain, 1 = Enable when program is launched, 2 = Enable on Boot, 3 = Enable on everything)
Write-Host "$($EnableStatus[0]) SysMain/Superfetch..."
Set-ItemProperty -Path "$PathToLMPrefetchParams" -Name "EnableSuperfetch" -Type DWord -Value $Zero
Write-Host "$($EnableStatus[0]) Remote Assistance..."
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value $Zero
Write-Host "[-][Priv&Perf] Disabling Ndu High RAM Usage..."
Set-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Services\Ndu" -Name "Start" -Type DWord -Value 4
# Details: https://www.tenforums.com/tutorials/94628-change-split-threshold-svchost-exe-windows-10-a.html
# Will reduce Processes number considerably on > 4GB of RAM systems
Write-Host "[+][Priv&Perf] Setting SVCHost to match RAM size..."
$Ram = (Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum / 1kb
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "SvcHostSplitThresholdInKB" -Type DWord -Value $Ram
Write-Host "[+][Priv&Perf] Unlimiting your network bandwidth for all your system..." # Based on this Chris Titus video: https://youtu.be/7u1miYJmJ_4
If (!(Test-Path "$PathToLMPoliciesPsched")) {
New-Item -Path "$PathToLMPoliciesPsched" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesPsched" -Name "NonBestEffortLimit" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "NetworkThrottlingIndex" -Type DWord -Value 0xffffffff
# [@] (2 = Disable, 4 = Enable)
Write-Host "[=][Priv&Perf] Enabling Windows Store apps Automatic Updates..."
If (!(Test-Path "$PathToLMPoliciesWindowsStore")) {
New-Item -Path "$PathToLMPoliciesWindowsStore" -Force | Out-Null
}
If ((Get-Item "$PathToLMPoliciesWindowsStore").GetValueNames() -like "AutoDownload") {
Remove-ItemProperty -Path "$PathToLMPoliciesWindowsStore" -Name "AutoDownload"
}
Write-Section -Text "Power Plan Tweaks"
Write-Host "[+][Priv&Perf] Setting Power Plan to High Performance..."
powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
# Found on the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\Default\PowerSchemes
Write-Host "[+][Priv&Perf] Enabling (Not setting) the Ultimate Performance Power Plan..."
powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61
Write-Section -Text "Network & Internet"
Write-Caption -Text "Proxy"
# Code from: https://www.reddit.com/r/PowerShell/comments/5iarip/set_proxy_settings_to_automatically_detect/?utm_source=share&utm_medium=web2x&context=3
Write-Host "[-][Priv&Perf] Fixing Edge slowdown by NOT Automatically Detecting Settings..."
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections'
$data = (Get-ItemProperty -Path $key -Name DefaultConnectionSettings).DefaultConnectionSettings
$data[8] = 3
Set-ItemProperty -Path $key -Name DefaultConnectionSettings -Value $data
}
function Main() {
# Initialize all Path variables used to Registry Tweaks
$Global:PathToLMActivityHistory = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System"
$Global:PathToLMAutoLogger = "HKLM:\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger"
$Global:PathToLMDeliveryOptimizationCfg = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config"
$Global:PathToLMPoliciesAdvertisingInfo = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo"
$Global:PathToLMPoliciesCloudContent = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
$Global:PathToLMPoliciesGameDVR = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR"
$Global:PathToLMPoliciesPsched = "HKLM:\SOFTWARE\Policies\Microsoft\Psched"
$Global:PathToLMPoliciesSQMClient = "HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows"
$Global:PathToLMPoliciesTelemetry = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection"
$Global:PathToLMPoliciesTelemetry2 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection"
$Global:PathToLMPoliciesToWifi = "HKLM:\Software\Microsoft\PolicyManager\default\WiFi"
$Global:PathToLMPoliciesWindowsStore = "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore"
$Global:PathToLMPoliciesWindowsUpdate = "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU"
$Global:PathToLMPrefetchParams = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters"
$Global:PathToLMWindowsTroubleshoot = "HKLM:\SOFTWARE\Microsoft\WindowsMitigation"
$Global:PathToCUContentDeliveryManager = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
$Global:PathToCUDeviceAccessGlobal = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global"
$Global:PathToCUGameBar = "HKCU:\SOFTWARE\Microsoft\GameBar"
$Global:PathToCUInputPersonalization = "HKCU:\SOFTWARE\Microsoft\InputPersonalization"
$Global:PathToCUInputTIPC = "HKCU:\SOFTWARE\Microsoft\Input\TIPC"
$Global:PathToCUOnlineSpeech = "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy"
$Global:PathToCUPoliciesCloudContent = "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
$Global:PathToCUSearch = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search"
$Global:PathToCUSiufRules = "HKCU:\SOFTWARE\Microsoft\Siuf\Rules"
$Zero = 0
$One = 1
$EnableStatus = @(
"[-][Priv&Perf] Disabling",
"[+][Priv&Perf] Enabling"
)
if (($Revert)) {
Write-Warning "[<][Priv&Perf] Reverting: $Revert."
$Zero = 1
$One = 0
$EnableStatus = @(
"[<][Priv&Perf] Re-Enabling",
"[<][Priv&Perf] Re-Disabling"
)
}
Optimize-PrivacyAndPerformance # Disable Registries that causes slowdowns and privacy invasion
}
Main