Guest User

Disable Performance Script

a guest
Oct 23rd, 2025
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # ------------------------------------------------------------
  2. # WINDOWS 11 RESTORATION SCRIPT
  3. # PURPOSE: Revert all system changes made by optimization script
  4. # Compatible with: Optimize-Windows11.ps1
  5. # ------------------------------------------------------------
  6. # Description:
  7. # This PowerShell script restores Windows 11 to its default state
  8. # by re-enabling essential services, restoring system apps,
  9. # reactivating telemetry, and returning to the balanced power plan.
  10. # It is designed to fully undo all optimizations applied by
  11. # the "Optimize-Windows11.ps1" script.
  12. #
  13. # How to Run:
  14. # 1. Save this file as "Restore-Windows11.ps1".
  15. # 2. Open PowerShell as Administrator and run: Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
  16. # 3. Right-click the file and select "Run with PowerShell".
  17. #    (Or open PowerShell as Administrator and execute it manually.)
  18. # 4. If script execution is blocked, run:
  19. #       Set-ExecutionPolicy Bypass -Scope Process -Force
  20. # 5. Once completed, restart your PC to apply all changes.
  21. # ------------------------------------------------------------
  22.  
  23. Write-Host "Starting restoration of Windows 11 default configuration..." -ForegroundColor Cyan
  24.  
  25. # 1. Restore essential services
  26. $services = @(
  27.   "SysMain",
  28.   "DiagTrack",
  29.   "WSearch",
  30.   "WerSvc",
  31.   "RemoteRegistry",
  32.   "Fax",
  33.   "RetailDemo",
  34.   "MapsBroker",
  35.   "SharedAccess",
  36.   "BluetoothSupportService",
  37.   "OneSyncSvc",
  38.   "PhoneSvc",
  39.   "CDPUserSvc",
  40.   "edgeupdate",
  41.   "edgeupdatem"
  42. )
  43.  
  44. foreach ($service in $services) {
  45.     Get-Service -Name $service -ErrorAction SilentlyContinue | ForEach-Object {
  46.         Set-Service -Name $_.Name -StartupType Automatic
  47.         Start-Service -Name $_.Name -ErrorAction SilentlyContinue
  48.         Write-Host "Service restored: $($_.Name)"
  49.     }
  50. }
  51.  
  52. # 2. Re-enable telemetry and diagnostic tasks
  53. Write-Host "Re-enabling telemetry tasks..." -ForegroundColor Yellow
  54. $tasks = @(
  55.   "\Microsoft\Windows\Application Experience\ProgramDataUpdater",
  56.   "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator",
  57.   "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip",
  58.   "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector",
  59.   "\Microsoft\Windows\Feedback\Siuf\DmClient",
  60.   "\Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload"
  61. )
  62. foreach ($task in $tasks) {
  63.   schtasks /Change /TN $task /Enable 2>$null
  64. }
  65.  
  66. # 3. Reinstall OneDrive
  67. Write-Host "Reinstalling OneDrive..." -ForegroundColor Yellow
  68. & "$env:SystemRoot\System32\OneDriveSetup.exe" /install
  69. Write-Host "OneDrive restored."
  70.  
  71. # 4. Re-enable Cortana and Widgets
  72. Write-Host "Re-enabling Cortana and Widgets..." -ForegroundColor Yellow
  73. reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowCortana /f
  74. reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds" /v ShellFeedsTaskbarViewMode /f
  75. reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds" /v EnableFeeds /f
  76.  
  77. # 5. Re-enable Edge AutoUpdate
  78. Write-Host "Re-enabling Edge automatic updates..." -ForegroundColor Yellow
  79. reg delete "HKLM\SOFTWARE\Policies\Microsoft\EdgeUpdate" /f
  80.  
  81. # 6. Restore power plan to Balanced
  82. Write-Host "Restoring Balanced power plan..." -ForegroundColor Yellow
  83. powercfg -setactive SCHEME_BALANCED
  84. powercfg -change -monitor-timeout-ac 10
  85. powercfg -change -disk-timeout-ac 20
  86. powercfg -change -standby-timeout-ac 30
  87. powercfg -hibernate on
  88.  
  89. # 7. Restore default visual effects
  90. Write-Host "Re-enabling visual effects and animations..." -ForegroundColor Yellow
  91. Set-ItemProperty "HKCU:\Control Panel\Desktop" "UserPreferencesMask" ([byte[]](0x9E,0x1E,0x07,0x80,0x12,0x00,0x00,0x00))
  92. Set-ItemProperty "HKCU:\Control Panel\Desktop\WindowMetrics" MinAnimate 1
  93. Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" VisualFXSetting 1
  94. Set-ItemProperty "HKCU:\Software\Microsoft\Windows\DWM" EnableAeroPeek 1
  95. Set-ItemProperty "HKCU:\Software\Microsoft\Windows\DWM" EnableBlurBehind 1
  96.  
  97. # 8. Restore Delivery Optimization and network settings
  98. Write-Host "Restoring Delivery Optimization and network configuration..." -ForegroundColor Yellow
  99. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name DODownloadMode -Value 1 -Force
  100. netsh int tcp set global autotuninglevel=normal
  101. netsh int tcp set global rss=default
  102. netsh int tcp set global chimney=default
  103.  
  104. # 9. Reinstall system apps (requires Microsoft Store)
  105. Write-Host "Reinstalling system apps (Microsoft Store required)..." -ForegroundColor Yellow
  106. Get-AppxPackage -AllUsers | ForEach-Object {
  107.     Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppxManifest.xml" -ErrorAction SilentlyContinue
  108. }
  109.  
  110. # 10. Restore Windows Defender default settings
  111. Write-Host "Restoring Windows Defender default settings..." -ForegroundColor Yellow
  112. Set-MpPreference -MAPSReporting 1 -ErrorAction SilentlyContinue
  113. Set-MpPreference -SubmitSamplesConsent 1 -ErrorAction SilentlyContinue
  114. Set-MpPreference -PUAProtection Enabled -ErrorAction SilentlyContinue
  115.  
  116. # Finalization
  117. Write-Host "System restoration completed successfully." -ForegroundColor Cyan
  118. Write-Host "Restart your PC to apply all changes." -ForegroundColor Green
  119.  
Advertisement
Add Comment
Please, Sign In to add comment