cls # Combined Windows 11 Pro Optimization Script # Συνδυασμός Optimize-Windows11-Pro.ps1 + tweakwin.ps1, χωρίς διπλές λειτουργίες # Το script θα αυτο-υψώνεται (self-elevate) σε Administrator αν χρειάζεται. # ========================= # SELF-ELEVATE AS ADMIN # ========================= $currIdentity = [Security.Principal.WindowsIdentity]::GetCurrent() $currPrincipal = New-Object Security.Principal.WindowsPrincipal($currIdentity) if (-not $currPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Host "Απαιτούνται δικαιώματα Διαχειριστή. Γίνεται επανεκκίνηση του script με UAC prompt..." -ForegroundColor Yellow $psi = New-Object System.Diagnostics.ProcessStartInfo $psi.FileName = "powershell.exe" $scriptPath = $PSCommandPath if (-not $scriptPath) { $scriptPath = $MyInvocation.MyCommand.Path } $psi.Arguments = "-ExecutionPolicy Bypass -File `"$scriptPath`"" $psi.Verb = "runas" # ζητάει UAC elevation [System.Diagnostics.Process]::Start($psi) | Out-Null exit } # ========================= # CONFIG / COMMON HELPERS # ========================= $ErrorActionPreference = "Continue" $ProgressPreference = "SilentlyContinue" # Έλεγχος Διαχειριστή (δεύτερο, για σιγουριά) if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent() ).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Host "Πρέπει να εκτελεστεί ως Διαχειριστής!" -ForegroundColor Red exit } function Write-Step { param([string]$Message) Write-Host "`n[$(Get-Date -Format 'HH:mm:ss')] " -ForegroundColor Cyan -NoNewline Write-Host "► $Message" -ForegroundColor White } function Write-Success { param([string]$Message) Write-Host " ✓ $Message" -ForegroundColor Green } function Write-Warning { param([string]$Message) Write-Host " ⚠ $Message" -ForegroundColor Yellow } function Write-Err { param([string]$Message) Write-Host " ✗ $Message" -ForegroundColor Red } function Confirm-Step { param([string]$Message) $choice = Read-Host "$Message (Y/N, default Y)" if ([string]::IsNullOrWhiteSpace($choice)) { return $true } if ($choice -eq 'N' -or $choice -eq 'n') { return $false } return $true } # HEADER Write-Host "╔════════════════════════════════════════════════════════════════╗" -ForegroundColor Cyan Write-Host "║ Windows 11 Pro - Combined Optimization Script ║" -ForegroundColor Cyan Write-Host "║ Base: Auto tweaks + Interactive debloat/privacy ║" -ForegroundColor Cyan Write-Host "╚════════════════════════════════════════════════════════════════╝" -ForegroundColor Cyan Write-Host "" # ============================================================ # 1. SYSTEM RESTORE POINT (AUTO) # ============================================================ Write-Step "Δημιουργία System Restore Point" try { Enable-ComputerRestore -Drive "$env:SystemDrive\" -ErrorAction SilentlyContinue Checkpoint-Computer -Description "Pre-Optimization-$(Get-Date -Format 'yyyy-MM-dd-HHmm')" -RestorePointType "MODIFY_SETTINGS" -ErrorAction Stop Write-Success "Restore point created successfully" } catch { Write-Warning "Could not create restore point (ίσως χρειάζεται χειροκίνητη ενεργοποίηση): $($_.Exception.Message)" } # ============================================================ # 2. POWER PLAN -> ULTIMATE / HIGH + USB/HDD (AUTO) # ============================================================ Write-Step "Ρύθμιση Power Plan & AC settings" try { $ultimateGuid = "e9a42b02-d5df-448d-aa00-03f14749eb61" powercfg -duplicatescheme $ultimateGuid 2>&1 | Out-Null $plans = powercfg /list $ultimatePlan = $plans | Select-String "Ultimate Performance" | ForEach-Object { if ($_ -match "([a-f0-9-]{36})") { $matches[1] } } if ($ultimatePlan) { powercfg /setactive $ultimatePlan Write-Success "Ultimate Performance power plan activated ($ultimatePlan)" } else { $highPerfGuid = "8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c" powercfg /setactive $highPerfGuid Write-Success "High Performance power plan activated ($highPerfGuid)" } # USB selective suspend off powercfg /setacvalueindex SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0 powercfg /setdcvalueindex SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0 Write-Success "USB selective suspend disabled" # HDD timeout off (AC) powercfg /setacvalueindex SCHEME_CURRENT 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e 0 Write-Success "Hard disk timeout disabled on AC power" } catch { Write-Err "Power plan configuration failed: $($_.Exception.Message)" } # ============================================================ # 3. VISUAL EFFECTS (BASE) - BEST PERFORMANCE (AUTO) # ============================================================ Write-Step "Βασική βελτιστοποίηση Visual Effects" try { Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Value 2 -Type DWord -Force Set-ItemProperty -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -Name "MinAnimate" -Value 0 -Type String -Force if (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize")) { New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "EnableTransparency" -Value 0 -Type DWord -Force Write-Success "Visual effects βασικά ρυθμισμένα για performance" } catch { Write-Err "Visual effects optimization failed: $($_.Exception.Message)" } # ============================================================ # 4. SSD OPTIMIZATION (TRIM, WRITE CACHE) (AUTO) # ============================================================ Write-Step "SSD Optimization (TRIM, write cache)" try { $ssds = Get-PhysicalDisk | Where-Object { $_.MediaType -eq "SSD" } foreach ($ssd in $ssds) { Write-Host " • SSD: $($ssd.FriendlyName)" -ForegroundColor Gray } Get-Volume | Where-Object { $_.DriveType -eq "Fixed" -and $_.DriveLetter } | ForEach-Object { try { Optimize-Volume -DriveLetter $_.DriveLetter -ReTrim -ErrorAction SilentlyContinue Write-Success "TRIM executed on drive $($_.DriveLetter):" } catch { Write-Warning "Could not TRIM drive $($_.DriveLetter) (ίσως δεν είναι SSD)" } } $disks = Get-WmiObject -Class Win32_DiskDrive foreach ($disk in $disks) { $disk.SetWriteCacheEnabled($true) | Out-Null } Write-Success "Write caching enabled on all drives" $defragTask = Get-ScheduledTask -TaskName "ScheduledDefrag" -ErrorAction SilentlyContinue if ($defragTask) { $defragTask | Enable-ScheduledTask | Out-Null Write-Success "Weekly TRIM schedule confirmed active" } } catch { Write-Err "SSD optimization encountered errors: $($_.Exception.Message)" } # ============================================================ # 5. DISABLE COMMON STARTUP BLOAT (AUTO) # ============================================================ Write-Step "Disabling common startup bloat" try { $startupAppsToDisable = @( "Microsoft Teams","Teams","OneDrive","Spotify", "Adobe*","CCleaner*","Discord","Skype*","iTunes*","Zoom*" ) $disabledCount = 0 Get-CimInstance -ClassName Win32_StartupCommand | ForEach-Object { $app = $_ foreach ($pattern in $startupAppsToDisable) { if ($app.Name -like $pattern) { try { $regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" if (Test-Path $regPath) { $value = Get-ItemProperty -Path $regPath -Name $app.Name -ErrorAction SilentlyContinue if ($value) { Remove-ItemProperty -Path $regPath -Name $app.Name -Force -ErrorAction SilentlyContinue Write-Success "Disabled startup: $($app.Name)" $disabledCount++ } } } catch {} } } } if ($disabledCount -eq 0) { Write-Success "No common bloatware startup apps found" } else { Write-Success "Disabled $disabledCount startup programs" } } catch { Write-Err "Startup program optimization failed: $($_.Exception.Message)" } # ============================================================ # 6. GAME BAR / TELEMETRY (BASE REDUCTION) (AUTO) # ============================================================ Write-Step "Βασική μείωση Xbox Game Bar & Telemetry" try { Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR" -Name "AppCaptureEnabled" -Value 0 -Type DWord -Force Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Value 0 -Type DWord -Force if (!(Test-Path "HKCU:\Software\Microsoft\GameBar")) { New-Item -Path "HKCU:\Software\Microsoft\GameBar" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\Software\Microsoft\GameBar" -Name "AutoGameModeEnabled" -Value 0 -Type DWord -Force Write-Success "Xbox Game Bar disabled (registry)" if (!(Test-Path "HKCU:\Software\Microsoft\Siuf\Rules")) { New-Item -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Value 0 -Type DWord -Force Write-Success "Windows feedback prompts disabled" } catch { Write-Err "Game Bar/Telemetry base tweak failed: $($_.Exception.Message)" } # ============================================================ # 7. BACKGROUND APPS + UPDATE TWEAKS (AUTO) # ============================================================ Write-Step "Background apps + Windows Update tweaks" try { if (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications")) { New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Name "GlobalUserDisabled" -Value 1 -Type DWord -Force Write-Success "Background apps globally restricted" if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsRunInBackground" -Value 2 -Type DWord -Force Write-Success "Store app background activity restricted" if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -Value 1 -Type DWord -Force Write-Success "Auto-restart after updates disabled" if (!(Test-Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings")) { New-Item -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Force | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "IsContinuousInnovationOptedIn" -Value 0 -Type DWord -Force Write-Success "Continuous update delivery disabled" } catch { Write-Warning "Some Windows Update / background tweaks may require GP: $($_.Exception.Message)" } # ============================================================ # 8. NETWORK + SYSTEM RESPONSIVENESS (AUTO) # ============================================================ Write-Step "Network throttling + system responsiveness" try { Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "NetworkThrottlingIndex" -Value 0xffffffff -Type DWord -Force Write-Success "Network throttling disabled" $adapters = Get-NetAdapter | Where-Object { $_.Status -eq "Up" } foreach ($adapter in $adapters) { $powerMgmt = Get-WmiObject MSPower_DeviceEnable -Namespace root\wmi | Where-Object { $_.InstanceName -match [regex]::Escape($adapter.PnPDeviceID) } if ($powerMgmt) { $powerMgmt.Enable = $false $powerMgmt.Put() | Out-Null Write-Success "Disabled NIC power management: $($adapter.Name)" } } Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "SystemResponsiveness" -Value 10 -Type DWord -Force Write-Success "System responsiveness optimized (foreground priority)" Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Value 0 -Type String -Force Write-Success "Menu show delay minimized" } catch { Write-Err "Network/responsiveness tweaks failed: $($_.Exception.Message)" } # ============================================================ # 9. TEMP FILE CLEANUP (AUTO) # ============================================================ Write-Step "Cleaning TEMP / Prefetch" try { $tempPaths = @( "$env:TEMP\*", "$env:SystemRoot\Temp\*", "$env:SystemRoot\Prefetch\*" ) $cleanedMB = 0 foreach ($path in $tempPaths) { if (Test-Path $path) { $beforeSize = (Get-ChildItem -Path $path -Recurse -Force -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum / 1MB Remove-Item -Path $path -Recurse -Force -ErrorAction SilentlyContinue $cleanedMB += $beforeSize } } Write-Success "Temp/Prefetch cleaned ~ $([math]::Round($cleanedMB,2)) MB" } catch { Write-Warning "Temp cleanup partial: $($_.Exception.Message)" } # ================================ # ΑΠΟ ΕΔΩ ΚΑΙ ΚΑΤΩ: INTERACTIVE # ================================ ## 10. Πλήρης Απεγκατάσταση OneDrive if (Confirm-Step "10) Πλήρης απεγκατάσταση OneDrive (uninstall + policy disable);") { Write-Host "Απεγκαθιστώ OneDrive..." -ForegroundColor Yellow taskkill /f /im OneDrive.exe 2>$null & "$env:SystemRoot\SysWOW64\OneDriveSetup.exe" /uninstall 2>$null & "$env:SystemRoot\System32\OneDriveSetup.exe" /uninstall 2>$null reg delete "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f 2>$null reg delete "HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f 2>$null reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /v "DisableFileSyncNGSC" /t REG_DWORD /d 1 /f 2>$null Write-Host "OneDrive απενεργοποιήθηκε." -ForegroundColor Green } ## 11. Full Telemetry/DiagTrack OFF (service + 0) if (Confirm-Step "11) Πλήρης απενεργοποίηση DiagTrack + Telemetry policy (AllowTelemetry=0);") { Write-Host "Απενεργοποιώ Telemetry/DiagTrack..." -ForegroundColor Yellow Stop-Service -Name "DiagTrack" -Force -ErrorAction SilentlyContinue Set-Service -Name "DiagTrack" -StartupType Disabled -ErrorAction SilentlyContinue reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f Write-Host "Telemetry απενεργοποιήθηκε (Level 0)." -ForegroundColor Green } ## 12. Bloatware UWP uninstall if (Confirm-Step "12) Απεγκατάσταση UWP bloatware apps (Weather, Solitaire κλπ);") { Write-Host "Απεγκαθιστώ Bloatware..." -ForegroundColor Yellow $apps = @( "*3DBuilder*","*BingWeather*","*GetHelp*","*Getstarted*", "*Microsoft3DViewer*","*MicrosoftOfficeHub*","*MicrosoftSolitaireCollection*", "*MixedReality*","*MSPaint*","*OneNote*","*People*", "*SkypeApp*","*WindowsAlarms*","*WindowsCamera*","*WindowsMaps*" ) foreach ($app in $apps) { Get-AppxPackage -AllUsers $app | Remove-AppxPackage -ErrorAction SilentlyContinue Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $app | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue } Write-Host "Bloatware αφαιρέθηκε." -ForegroundColor Green } ## 13. Full Xbox removal if (Confirm-Step "13) Πλήρης απεγκατάσταση Xbox apps (περιλαμβάνει Game Bar components);") { Write-Host "Απεγκαθιστώ Xbox..." -ForegroundColor Yellow Get-AppxPackage -AllUsers "*Xbox*" | Remove-AppxPackage -ErrorAction SilentlyContinue Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like "*Xbox*" | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue Write-Host "Xbox apps αφαιρέθηκαν." -ForegroundColor Green } ## 14. Copilot/AI OFF (App + Policy) if (Confirm-Step "14) Απενεργοποίηση Copilot/AI (uninstall app + policy);") { Write-Host "Απενεργοποιώ Copilot..." -ForegroundColor Yellow Get-AppxPackage -AllUsers "*Copilot*" | Remove-AppxPackage -ErrorAction SilentlyContinue reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" /v "TurnOffWindowsCopilot" /t REG_DWORD /d 1 /f Write-Host "Copilot απενεργοποιήθηκε." -ForegroundColor Green } ## 15. Services manual/disabled (Fax/Search/Xbox/WerSvc) if (Confirm-Step "15) Services: Fax, Search, Xbox σε Manual + WerSvc Disabled;") { Write-Host "Ρυθμίζω Services..." -ForegroundColor Yellow $servicesManual = @("Fax","WSearch","WbioSrvc","WMPNetworkSvc","XblAuthManager","XblGameSave","XboxNetApiSvc") foreach ($svc in $servicesManual) { if (Get-Service -Name $svc -ErrorAction SilentlyContinue) { Stop-Service -Name $svc -Force -ErrorAction SilentlyContinue Set-Service -Name $svc -StartupType Manual -ErrorAction SilentlyContinue Write-Host "$svc -> Manual" } } if (Get-Service -Name "WerSvc" -ErrorAction SilentlyContinue) { Write-Host "Απενεργοποιώ WerSvc..." -ForegroundColor Yellow Set-Service -Name "WerSvc" -StartupType Disabled -ErrorAction SilentlyContinue Stop-Service -Name "WerSvc" -Force -ErrorAction SilentlyContinue Write-Host "WerSvc -> Disabled." -ForegroundColor Green } Write-Host "Services ρυθμίστηκαν." -ForegroundColor Green } ## 16. Win32PrioritySeparation=26 + verify + extra animations off if (Confirm-Step "16) Win32PrioritySeparation=26 + extra UI animations off;") { Write-Host "Εφαρμόζω Win32PrioritySeparation=26..." -ForegroundColor Yellow Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\PriorityControl" -Name "Win32PrioritySeparation" -Value 26 $currentPrio = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\PriorityControl" -Name "Win32PrioritySeparation" Write-Host ("Win32PrioritySeparation τρέχουσα τιμή (decimal): {0}" -f $currentPrio.Win32PrioritySeparation) -ForegroundColor Cyan # Επιπλέον animations off via UserPreferencesMask + VisualFXSetting Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Value ([byte[]](0x90,0x12,0x03,0x80,0x10,0x00,0x00,0x00)) Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Value 2 -Force Write-Host "Ίσως χρειαστεί logoff/restart για πλήρη εφαρμογή." -ForegroundColor Cyan Write-Host "Tweaks εφαρμόστηκαν." -ForegroundColor Green } ## 17. DNS cache clear if (Confirm-Step "17) Clear-DnsClientCache + ipconfig /flushdns;") { Write-Host "Καθαρίζω DNS client cache..." -ForegroundColor Yellow Clear-DnsClientCache ipconfig /flushdns | Out-Null Write-Host "DNS cache καθαρίστηκε." -ForegroundColor Green } ## 18. SysMain (Superfetch) OFF if (Confirm-Step "18) Απενεργοποίηση SysMain (Superfetch) service;") { Write-Host "Απενεργοποιώ SysMain..." -ForegroundColor Yellow if (Get-Service -Name "SysMain" -ErrorAction SilentlyContinue) { Stop-Service SysMain -Force -ErrorAction SilentlyContinue Set-Service SysMain -StartupType Disabled -ErrorAction SilentlyContinue Write-Host "SysMain -> Disabled." -ForegroundColor Green } else { Write-Host "SysMain service δεν βρέθηκε." -ForegroundColor Red } } ## 19. Processor Affinity helper if (Confirm-Step "19) Ρύθμιση Processor Affinity για συγκεκριμένο process (π.χ. chrome);") { $pName = Read-Host "Δώσε process name (π.χ. chrome, msedge, firefox)" if (-not [string]::IsNullOrWhiteSpace($pName)) { try { $procs = Get-Process -Name $pName -ErrorAction Stop $affinity = Read-Host "Affinity mask (decimal, π.χ. 15=4 cores, 3=core0+1). Default 15" if ([string]::IsNullOrWhiteSpace($affinity)) { $affinity = 15 } $affinityInt = [int]$affinity foreach ($proc in $procs) { $proc.ProcessorAffinity = [IntPtr]$affinityInt Write-Host "ProcessorAffinity για $($proc.ProcessName) (PID $($proc.Id)) -> $affinityInt" -ForegroundColor Green } } catch { Write-Host "Process '$pName' δεν βρέθηκε." -ForegroundColor Red } } } ## 20. Foreground priority monitor script if (Confirm-Step "20) Δημιουργία ProcessPriority.ps1 (foreground High, background BelowNormal);") { Write-Host "Δημιουργώ ProcessPriority.ps1..." -ForegroundColor Yellow $prioScript = @" Add-Type @' using System; using System.Runtime.InteropServices; public class Win32 { [DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll")] public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); } '@ while (`$true) { `$hwnd = [Win32]::GetForegroundWindow() `$id = 0 [Win32]::GetWindowThreadProcessId(`$hwnd, [ref]`$id) | Out-Null `$fgProc = Get-Process -Id `$id -ErrorAction SilentlyContinue if (`$fgProc -and `$fgProc.MainWindowTitle) { `$fgProc.PriorityClass = 'High' Write-Host "High: `$($fgProc.Name)" -ForegroundColor Green } Get-Process | Where-Object { `$_`.Id -ne `$id -and `$_`.MainWindowTitle } | ForEach-Object { `$_`.PriorityClass = 'BelowNormal' } Start-Sleep 5 } "@ $prioScript | Out-File "ProcessPriority.ps1" -Encoding UTF8 Write-Host "Έτοιμο. Τρέξτο με: powershell -WindowStyle Hidden -File .\ProcessPriority.ps1" -ForegroundColor Cyan } ## 21. Disk Cleanup + compact /U /S /I C:\ if (Confirm-Step "21) Disk Cleanup (cleanmgr /sagerun:1) + compact /U /S /I C:\;") { Write-Host "Εκτελώ Disk Cleanup (cleanmgr /sagerun:1)..." -ForegroundColor Yellow Start-Process cleanmgr -ArgumentList "/sagerun:1" -NoNewWindow -Wait Write-Host "Κάνω uncompress όλα τα αρχεία στο C:\..." -ForegroundColor Yellow compact /U /S /I C:\ Write-Host "Disk cleanup & uncompress ολοκληρώθηκαν." -ForegroundColor Green } Write-Host "" Write-Host "╔════════════════════════════════════════════════════════════════╗" -ForegroundColor Green Write-Host "║ COMBINED OPTIMIZATION COMPLETED ║" -ForegroundColor Green Write-Host "╚════════════════════════════════════════════════════════════════╝" -ForegroundColor Green Write-Host "⚠ Συνιστάται restart για πλήρη εφαρμογή." -ForegroundColor Yellow