All Tweaks

Windows Features

Disable Legacy Components

Remove outdated and rarely-used Windows components

Benefit

Reduces system bloat, improves startup time, and enhances security by removing old code

Impact

low

Commands (1)

$ErrorActionPreference='Continue'; $features = @('Internet-Explorer-Optional-amd64','WindowsMediaPlayer','DirectPlay','LegacyComponents','MicrosoftWindowsPowerShellV2','MicrosoftWindowsPowerShellV2Root'); foreach ($f in $features) { $w = Get-WindowsOptionalFeature -Online -FeatureName $f -ErrorAction SilentlyContinue; if (-not $w) { Write-Host "[SKIP] $f - not available on this system"; continue } if ($w.State -eq 'Disabled' -or $w.State -eq 'DisabledWithPayloadRemoved') { Write-Host "[OK] $f - already disabled"; continue } try { Disable-WindowsOptionalFeature -Online -FeatureName $f -NoRestart -WarningAction SilentlyContinue -ErrorAction Stop | Out-Null; Write-Host "[OK] Disabled $f" } catch { Write-Host "[ERR] $f - $($_.Exception.Message)" } }