# Disable Windows Search indexing Stop-Service "WSearch" -Force -ErrorAction SilentlyContinue Set-Service "WSearch" -StartupType Disabled # Disable Superfetch (SysMain) Stop-Service "SysMain" -Force -ErrorAction SilentlyContinue Set-Service "SysMain" -StartupType Disabled # Disable telemetry services $telemetryServices = @( "DiagTrack", # Connected User Experiences and Telemetry "dmwappushservice" # dmwappushsvc ) foreach ($svc in $telemetryServices) { Stop-Service $svc -Force -ErrorAction SilentlyContinue Set-Service $svc -StartupType Disabled } # Disable Bing web results in Start menu search New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Force | Out-Null Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Value 0 -Type DWord Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -Value 0 -Type DWord # Adjust for best performance (visual effects) $performanceKey = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" New-Item -Path $performanceKey -Force | Out-Null Set-ItemProperty -Path $performanceKey -Name "VisualFXSetting" -Value 2 -Type DWord # Clean up temp files $env:temp, $env:windir + "\Temp" | ForEach-Object { Get-ChildItem $_ -Recurse -Force -ErrorAction SilentlyContinue | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue } Write-Output "`n✅ Optimization complete. A reboot is recommended."