<# .SYNOPSIS Restore-Windows11 - Safe Revert Script for DebloatWindows11. .DESCRIPTION Restores default Windows 11 settings, re-enables modern context menu, restores default search settings, and removes registry policies. .LINK https://debloatwindows11.com/ #> $isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) if (-not $isAdmin) { Write-Host "[!] Administrative privileges required. Re-launching as Administrator..." -ForegroundColor Yellow Start-Process powershell.exe -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs exit } Clear-Host Write-Host "==============================================================" -ForegroundColor Yellow Write-Host " DebloatWindows11 - Default Settings Restore Utility" -ForegroundColor White Write-Host " Website: https://debloatwindows11.com/" -ForegroundColor DarkGray Write-Host "==============================================================" -ForegroundColor Yellow Write-Host "" Write-Host "[+] Reverting Classic Context Menu to Windows 11 default..." -ForegroundColor Cyan Remove-Item -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" -Recurse -Force -ErrorAction SilentlyContinue Write-Host " [OK] Restored." -ForegroundColor Green Write-Host "[+] Re-enabling Copilot and Search features..." -ForegroundColor Cyan Remove-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\WindowsCopilot" -Name "TurnOffWindowsCopilot" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" -Name "TurnOffWindowsCopilot" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableSearchBoxSuggestions" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -ErrorAction SilentlyContinue Write-Host " [OK] Restored." -ForegroundColor Green Write-Host "[+] Re-enabling Diagnostic Telemetry and Services..." -ForegroundColor Cyan Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -ErrorAction SilentlyContinue Set-Service -Name "DiagTrack" -StartupType Automatic -ErrorAction SilentlyContinue Start-Service -Name "DiagTrack" -ErrorAction SilentlyContinue Write-Host " [OK] Restored." -ForegroundColor Green Write-Host "[+] Re-enabling Advertising ID & Start suggestions..." -ForegroundColor Cyan Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Value 1 -ErrorAction SilentlyContinue Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Value 1 -ErrorAction SilentlyContinue Write-Host " [OK] Restored." -ForegroundColor Green Write-Host "" Write-Host "[+] Restarting Windows Explorer..." -ForegroundColor Cyan Stop-Process -Name "explorer" -Force -ErrorAction SilentlyContinue Start-Sleep -Seconds 1 Start-Process "explorer.exe" Write-Host "" Write-Host "==============================================================" -ForegroundColor Green Write-Host " [SUCCESS] Windows 11 settings successfully reverted to defaults." -ForegroundColor Green Write-Host "==============================================================" -ForegroundColor Green Read-Host "Press Enter to exit..."