Open Powershell (Run As Administrator)
Copy Below full and Paste in Powershell and run:

🔥 GET THE SCRIPT HERE:
# ------------------------------------------------------------------------
# Windows 10/11 Performance & Privacy Optimization Script (2026 Edition)
# Author: DOITEK
# Features: Restore Point, Logging, Safety Prompts, Revert Option, Better Structure
# Fixed: Network Sharing & Device Discovery Preserved
# ------------------------------------------------------------------------

# Run as Administrator
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Host "Please run this script as Administrator!" -ForegroundColor Red
    exit
}

$LogFile = "$env:USERPROFILE\Desktop\WindowsOptimization_Log_$(Get-Date -Format 'yyyyMMdd_HHmmss').txt"
function Write-Log {
    param([string]$Message, [string]$Color = "White")
    $Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
    "$Timestamp - $Message" | Out-File -FilePath $LogFile -Append
    Write-Host "$Message" -ForegroundColor $Color
}

Write-Log "=== Windows Optimization Script Started ===" "Cyan"

# 1. Create System Restore Point
Write-Log "Creating System Restore Point..." "Cyan"
try {
    Checkpoint-Computer -Description "BeforeServiceOptimization_$(Get-Date -Format 'yyyyMMdd_HHmm')" -RestorePointType "MODIFY_SETTINGS" -ErrorAction Stop
    Write-Log "Restore Point created successfully." "Green"
} catch {
    Write-Log "Failed to create Restore Point. Continuing anyway..." "Yellow"
}

# 2. Services to Disable (Network Discovery & Sharing Kept Safe!)
$ServicesToDisable = @(
    "DiagTrack",           # Connected User Experiences and Telemetry
    "dmwappushservice",    # WAP Push Message Routing
    "WerSvc",              # Windows Error Reporting
    "PcaSvc",              # Program Compatibility Assistant
    "WbioSrvc",            # Windows Biometric Service (if no biometrics)
    "XblAuthManager",      # Xbox Live
    "XblGameSave",
    "XboxNetApiSvc",
    "Fax",                 # Fax
    "PrintWorkflowUserSvc*", # Print Workflow (wildcard for multiple instances)
    "AJRouter",            # AllJoyn Router
    "RemoteRegistry",      # Remote Registry
    "MapsBroker",          # Downloaded Maps Manager
    "WSearch"              # Windows Search (indexing) - optional, big performance win on some systems
)

# 3. User Confirmation
Write-Log "`nThis script will disable telemetry, Xbox services, and other non-essential services." "Yellow"
Write-Log "NOTE: Network PC discovery and local file sharing will remain untouched." "Green"
$Confirm = Read-Host "Do you want to continue? (Y/N)"
if ($Confirm -notmatch "^Y") {
    Write-Log "Script cancelled by user." "Red"
    exit
}

# 4. Process Services
Write-Log "`nDisabling Services..." "Cyan"
foreach ($Service in $ServicesToDisable) {
    Get-Service -Name $Service -ErrorAction SilentlyContinue | ForEach-Object {
        try {
            if ($_.Status -eq 'Running') {
                Stop-Service -Name $_.Name -Force -ErrorAction Stop
                Write-Log "Stopped: $($_.Name)" "Yellow"
            }
            Set-Service -Name $_.Name -StartupType Disabled -ErrorAction Stop
            Write-Log "Disabled: $($_.Name) - $($_.DisplayName)" "Green"
        } catch {
            Write-Log "Failed to disable: $($_.Name) - $($_.Exception.Message)" "Red"
        }
    }
}

# 5. Disable Telemetry Scheduled Tasks
Write-Log "`nDisabling Telemetry Scheduled Tasks..." "Cyan"
$TasksToDisable = @(
    "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator",
    "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip",
    "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser",
    "\Microsoft\Windows\Application Experience\ProgramDataUpdater",
    "\Microsoft\Windows\Autochk\Proxy",
    "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector"
)

foreach ($Task in $TasksToDisable) {
    if (Get-ScheduledTask -TaskPath (Split-Path $Task) -TaskName (Split-Path $Task -Leaf) -ErrorAction SilentlyContinue) {
        Disable-ScheduledTask -TaskPath (Split-Path $Task) -TaskName (Split-Path $Task -Leaf) | Out-Null
        Write-Log "Disabled Task: $Task" "Green"
    }
}

# 6. Extra Performance Tweaks (Optional but Recommended)
Write-Log "`nApplying Extra Performance Tweaks..." "Cyan"

# Disable Delivery Optimization
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Value 0 -ErrorAction SilentlyContinue

# Disable Background Apps
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Name "GlobalUserDisabled" -Value 1 -ErrorAction SilentlyContinue

Write-Log "`nOptimization completed successfully!" "Magenta"
Write-Log "Log file saved at: $LogFile" "Cyan"
Write-Log "It is highly recommended to restart your computer now." "Yellow"