Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ------------------------------------------------------------
- # WINDOWS 11 PERFORMANCE OPTIMIZATION FOR REMOTE STREAMING
- # MODE: MAXIMUM PERFORMANCE (Defender enabled)
- # ------------------------------------------------------------
- # Description:
- # This PowerShell script optimizes Windows 11 for remote streaming
- # by disabling unnecessary services, removing bloatware,
- # minimizing visual effects, and enabling the maximum performance plan.
- # Windows Defender remains active to ensure system protection.
- #
- # How to Run:
- # 1. Save this script as "Optimize-Windows11.ps1".
- # 2. Open PowerShell as Administrator and run: Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
- # 3. Right-click the file and select "Run with PowerShell".
- # (Alternatively, open PowerShell as Administrator and run it manually.)
- # 4. If execution is blocked, enable script execution temporarily:
- # Set-ExecutionPolicy Bypass -Scope Process -Force
- # 5. After execution, restart your PC to apply all optimizations.
- # ------------------------------------------------------------
- Write-Host "Starting advanced Windows 11 optimization..." -ForegroundColor Cyan
- # 1. Stop and disable unnecessary services
- $services = @(
- "SysMain",
- "DiagTrack",
- "WSearch",
- "WerSvc",
- "RemoteRegistry",
- "Fax",
- "RetailDemo",
- "MapsBroker",
- "SharedAccess",
- "BluetoothSupportService",
- "OneSyncSvc",
- "PhoneSvc",
- "CDPUserSvc",
- "edgeupdate",
- "edgeupdatem"
- )
- foreach ($service in $services) {
- Get-Service -Name $service -ErrorAction SilentlyContinue | ForEach-Object {
- Stop-Service -Name $_.Name -ErrorAction SilentlyContinue
- Set-Service -Name $_.Name -StartupType Disabled
- Write-Host "Service disabled: $($_.Name)"
- }
- }
- # 2. Disable telemetry and diagnostic scheduled tasks
- Write-Host "Disabling telemetry tasks..." -ForegroundColor Yellow
- $tasks = @(
- "\Microsoft\Windows\Application Experience\ProgramDataUpdater",
- "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator",
- "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip",
- "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector",
- "\Microsoft\Windows\Feedback\Siuf\DmClient",
- "\Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload"
- )
- foreach ($task in $tasks) {
- schtasks /Change /TN $task /Disable 2>$null
- }
- # 3. Disable and remove OneDrive integration
- Write-Host "Removing OneDrive..." -ForegroundColor Yellow
- taskkill /f /im OneDrive.exe 2>$null
- Start-Sleep -s 2
- & "$env:SystemRoot\System32\OneDriveSetup.exe" /uninstall
- Remove-Item "$env:UserProfile\OneDrive" -Recurse -Force -ErrorAction SilentlyContinue
- Remove-Item "C:\OneDriveTemp" -Recurse -Force -ErrorAction SilentlyContinue
- Write-Host "OneDrive removed."
- # 4. Disable Cortana, Widgets, and News
- Write-Host "Disabling Cortana and Widgets..." -ForegroundColor Yellow
- reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowCortana /t REG_DWORD /d 0 /f
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds" /v ShellFeedsTaskbarViewMode /t REG_DWORD /d 2 /f
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds" /v EnableFeeds /t REG_DWORD /d 0 /f
- Write-Host "Cortana and Widgets disabled."
- # 5. Disable Edge AutoUpdate (keeps Edge installed)
- Write-Host "Disabling Edge auto updates..." -ForegroundColor Yellow
- reg add "HKLM\SOFTWARE\Policies\Microsoft\EdgeUpdate" /v AutoUpdateCheckPeriodMinutes /t REG_DWORD /d 0 /f
- reg add "HKLM\SOFTWARE\Policies\Microsoft\EdgeUpdate" /v UpdateDefault /t REG_DWORD /d 0 /f
- # 6. Set power plan to maximum performance
- Write-Host "Setting power plan to maximum performance..." -ForegroundColor Yellow
- powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 >$null
- powercfg -setactive e9a42b02-d5df-448d-aa00-03f14749eb61
- powercfg -change -monitor-timeout-ac 0
- powercfg -change -disk-timeout-ac 0
- powercfg -change -standby-timeout-ac 0
- powercfg -hibernate off
- Write-Host "Power plan set."
- # 7. Minimize visual effects
- Write-Host "Disabling animations, transparency, and effects..." -ForegroundColor Yellow
- Set-ItemProperty "HKCU:\Control Panel\Desktop" "UserPreferencesMask" ([byte[]](0x90,0x12,0x03,0x80,0x10,0x00,0x00,0x00))
- Set-ItemProperty "HKCU:\Control Panel\Desktop\WindowMetrics" MinAnimate 0
- Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" VisualFXSetting 2
- Set-ItemProperty "HKCU:\Software\Microsoft\Windows\DWM" EnableAeroPeek 0
- Set-ItemProperty "HKCU:\Software\Microsoft\Windows\DWM" EnableBlurBehind 0
- # 8. Remove unnecessary preinstalled apps
- Write-Host "Removing unnecessary apps..." -ForegroundColor Yellow
- $apps = @(
- "*xbox*", "*bing*", "*news*", "*weather*", "*onenote*", "*skype*",
- "*feedback*", "*maps*", "*solitaire*", "*people*", "*cortana*", "*getstarted*"
- )
- foreach ($app in $apps) {
- Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -ErrorAction SilentlyContinue
- }
- # 9. Optimize network and disable Delivery Optimization
- Write-Host "Disabling Delivery Optimization and P2P services..." -ForegroundColor Yellow
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name DODownloadMode -Value 0 -Force
- netsh int tcp set global autotuninglevel=disabled
- netsh int tcp set global rss=enabled
- netsh int tcp set global chimney=enabled
- # 10. Keep Windows Defender active but reduce telemetry
- Write-Host "Keeping Windows Defender active (efficient mode)..." -ForegroundColor Yellow
- Set-MpPreference -MAPSReporting 0 -ErrorAction SilentlyContinue
- Set-MpPreference -SubmitSamplesConsent 2 -ErrorAction SilentlyContinue
- Set-MpPreference -PUAProtection Enabled -ErrorAction SilentlyContinue
- # Final cleanup
- Write-Host "Final cleanup and summary..." -ForegroundColor Cyan
- Start-Sleep -s 2
- Write-Host "Services minimized"
- Write-Host "Visual effects disabled"
- Write-Host "Telemetry and bloatware removed"
- Write-Host "Windows Defender optimized and active"
- Write-Host "Restart your PC to apply all changes." -ForegroundColor Green
Add Comment
Please, Sign In to add comment