$Mode='boost' # ValBoost - one-command Windows tune-up for VALORANT. # Paste into Win+R or any PowerShell window: # powershell -ep bypass -c "irm https://valboost.rennko.tech | iex" apply everything # powershell -ep bypass -c "irm https://valboost.rennko.tech/undo | iex" put it all back # (The server sets $Mode before this script; run locally it defaults to boost.) & { $ErrorActionPreference = 'SilentlyContinue' $Mode = if ($Mode -eq 'undo') { 'undo' } else { 'boost' } $Url = 'https://valboost.rennko.tech' + $(if ($Mode -eq 'undo') { '/undo' } else { '' }) $Home_ = Join-Path $env:LOCALAPPDATA 'ValBoost' $Backup = Join-Path $Home_ 'backup.json' $GameExe = 'VALORANT-Win64-Shipping.exe' # --- relaunch as admin (power plan + HKLM keys need it) --- $admin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) if (-not $admin) { Write-Host ' ValBoost needs admin - click Yes on the prompt.' -ForegroundColor Yellow if ($PSCommandPath) { $cmd = "-NoProfile -ExecutionPolicy Bypass -Command `"`$Mode='$Mode'; & '$PSCommandPath'`"" } else { $cmd = "-NoProfile -ExecutionPolicy Bypass -Command `"irm $Url | iex`"" } try { Start-Process (Get-Process -Id $PID).Path -Verb RunAs -ArgumentList $cmd -ErrorAction Stop } catch { Write-Host '' Write-Host ' Windows would not open an admin window from here.' -ForegroundColor Red Write-Host ' Do this instead:' -ForegroundColor Gray Write-Host ' 1. Right-click the Start button > Terminal (Admin) (or "Windows PowerShell (Admin)")' -ForegroundColor Gray Write-Host ' 2. Click Yes, then paste:' -ForegroundColor Gray Write-Host " irm $Url | iex" -ForegroundColor White Write-Host '' } return } New-Item -ItemType Directory -Force -Path $Home_ | Out-Null $Host.UI.RawUI.WindowTitle = 'ValBoost' function Say($msg, $color = 'Gray') { Write-Host " $msg" -ForegroundColor $color } function Ok($msg) { Write-Host ' [+] ' -ForegroundColor Green -NoNewline; Write-Host $msg } function Finish($secs) { Write-Host '' for ($i = $secs; $i -gt 0; $i--) { Write-Host "`r Closing in $i s " -NoNewline -ForegroundColor DarkGray; Start-Sleep 1 } } # Every registry value we touch: path, name, new value, type, description $MM = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile' $Tweaks = @( @{ P='HKCU:\Software\Microsoft\GameBar'; N='AutoGameModeEnabled'; V=1; T='DWord'; D='Game Mode on' }, @{ P='HKCU:\Software\Microsoft\GameBar'; N='AllowAutoGameMode'; V=1; T='DWord'; D='' }, @{ P='HKCU:\System\GameConfigStore'; N='GameDVR_Enabled'; V=0; T='DWord'; D='Xbox background recording off' }, @{ P='HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR'; N='AppCaptureEnabled'; V=0; T='DWord'; D='' }, @{ P='HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers'; N='HwSchMode'; V=2; T='DWord'; D='Hardware GPU scheduling on (after reboot)' }, @{ P=$MM; N='SystemResponsiveness'; V=10; T='DWord'; D='Games get more CPU time vs background tasks' }, @{ P=$MM; N='NetworkThrottlingIndex';V=0xFFFFFFFF; T='DWord'; D='Network throttling off' }, @{ P="$MM\Tasks\Games"; N='GPU Priority'; V=8; T='DWord'; D='Windows game scheduler: high priority' }, @{ P="$MM\Tasks\Games"; N='Priority'; V=6; T='DWord'; D='' }, @{ P="$MM\Tasks\Games"; N='Scheduling Category'; V='High'; T='String'; D='' }, @{ P="$MM\Tasks\Games"; N='SFIO Priority'; V='High'; T='String'; D='' }, @{ P="HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$GameExe\PerfOptions"; N='CpuPriorityClass'; V=3; T='DWord'; D='VALORANT always launches at High CPU priority' } ) function Find-Valorant { # Riot writes the install path here $yaml = 'C:\ProgramData\Riot Games\Metadata\valorant.live\valorant.live.product_settings.yaml' if (Test-Path $yaml) { $m = Select-String -Path $yaml -Pattern 'product_install_full_path:\s*"?([^"\r\n]+)"?' | Select-Object -First 1 if ($m) { $exe = Join-Path $m.Matches[0].Groups[1].Value "ShooterGame\Binaries\Win64\$GameExe" if (Test-Path $exe) { return (Resolve-Path $exe).Path } } } foreach ($d in (Get-PSDrive -PSProvider FileSystem).Root) { foreach ($sub in 'Riot Games\VALORANT\live', 'Games\Riot Games\VALORANT\live', 'Program Files\Riot Games\VALORANT\live') { $exe = Join-Path $d "$sub\ShooterGame\Binaries\Win64\$GameExe" if (Test-Path $exe) { return $exe } } } return $null } function Read-Value($p, $n) { if (-not (Test-Path $p)) { return @{ Exists = $false } } $item = Get-ItemProperty -Path $p -Name $n -ErrorAction SilentlyContinue if ($null -eq $item) { return @{ Exists = $false } } $kind = (Get-Item $p).GetValueKind($n).ToString() return @{ Exists = $true; Value = $item.$n; Kind = $kind } } function Set-Value($p, $n, $v, $t) { if (-not (Test-Path $p)) { New-Item -Path $p -Force | Out-Null } New-ItemProperty -Path $p -Name $n -Value $v -PropertyType $t -Force | Out-Null } # ================================ UNDO ================================ if ($Mode -eq 'undo') { Write-Host "`n ValBoost - restoring your old settings`n" -ForegroundColor Cyan if (-not (Test-Path $Backup)) { Say 'No backup found - nothing to undo.' Yellow; Finish 8; return } $b = Get-Content $Backup -Raw | ConvertFrom-Json foreach ($r in $b.Registry) { if ($r.Exists) { Set-Value $r.P $r.N $r.Value $r.Kind } else { Remove-ItemProperty -Path $r.P -Name $r.N -Force } } $ifeo = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$GameExe" foreach ($k in "$ifeo\PerfOptions", $ifeo) { if ((Test-Path $k) -and (Get-Item $k).ValueCount -eq 0 -and (Get-Item $k).SubKeyCount -eq 0) { Remove-Item $k -Force } } Ok 'Registry values restored' if ($b.PowerPlan) { powercfg /setactive $b.PowerPlan | Out-Null; Ok 'Old power plan re-activated' } if ($b.CreatedPlan) { powercfg /delete $b.CreatedPlan | Out-Null } Remove-Item $Backup -Force Write-Host "`n Done. Reboot to fully undo GPU scheduling." -ForegroundColor Cyan Finish 10 return } # ================================ BOOST ================================ Write-Host '' Write-Host ' V A L B O O S T' -ForegroundColor Red Write-Host " tuning this PC for VALORANT`n" -ForegroundColor DarkGray $exe = Find-Valorant $gpuKey = 'HKCU:\Software\Microsoft\DirectX\UserGpuPreferences' if ($exe) { $Tweaks += @{ P=$gpuKey; N=$exe; V='GpuPreference=2;'; T='String'; D='VALORANT forced onto your best GPU' } } # 1. Back up (only the first time, so a second run never overwrites the real originals) if (-not (Test-Path $Backup)) { $plan = (powercfg /getactivescheme) -replace '.*GUID:\s*([0-9a-f-]+).*', '$1' $snap = @{ PowerPlan = "$plan".Trim(); CreatedPlan = $null; Registry = @() } foreach ($t in $Tweaks) { $cur = Read-Value $t.P $t.N $snap.Registry += @{ P=$t.P; N=$t.N; Exists=$cur.Exists; Value=$cur.Value; Kind=$cur.Kind } } $snap | ConvertTo-Json -Depth 5 | Set-Content $Backup -Encoding UTF8 Ok 'Backed up current settings (the undo command puts them back)' } else { Say 'Backup already exists from an earlier run - keeping the original.' DarkGray } # 2. Registry tweaks foreach ($t in $Tweaks) { Set-Value $t.P $t.N $t.V $t.T if ($t.D) { Ok $t.D } } if (-not $exe) { Say "Couldn't find VALORANT's folder - skipped the GPU preference." Yellow } # 3. Power plan: Ultimate Performance, else High Performance $ultimate = 'e9a42b02-d5df-448d-aa00-03f14749eb61' $guid = $null $existing = (powercfg /list) | Select-String 'Ultimate Performance' | Select-Object -First 1 if ($existing) { $guid = ("$existing" -replace '.*GUID:\s*([0-9a-f-]+).*', '$1').Trim() } else { $out = powercfg /duplicatescheme $ultimate $guid = ("$out" -replace '.*GUID:\s*([0-9a-f-]+).*', '$1').Trim() if ($guid -match '^[0-9a-f-]{36}$') { $b = Get-Content $Backup -Raw | ConvertFrom-Json if (-not $b.CreatedPlan) { $b.CreatedPlan = $guid; $b | ConvertTo-Json -Depth 5 | Set-Content $Backup -Encoding UTF8 } } } if ($guid -match '^[0-9a-f-]{36}$') { powercfg /setactive $guid | Out-Null; Ok 'Power plan: Ultimate Performance' } else { powercfg /setactive SCHEME_MIN | Out-Null; Ok 'Power plan: High Performance' } # 4. Close background launchers that eat RAM/CPU (they restart on their own later) $hogs = 'OneDrive', 'Teams', 'ms-teams', 'EpicGamesLauncher', 'EADesktop', 'Battle.net', 'GalaxyClient', 'Cortana' $closed = Get-Process -Name $hogs -ErrorAction SilentlyContinue if ($closed) { $closed | Stop-Process -Force; Ok ('Closed background apps: ' + (($closed.Name | Sort-Object -Unique) -join ', ')) } # 5. Clean temp files + flush DNS $dirs = $env:TEMP, "$env:WINDIR\Temp" $before = (Get-ChildItem $dirs -Recurse -Force -File | Measure-Object Length -Sum).Sum Get-ChildItem $dirs -Force | Remove-Item -Recurse -Force $after = (Get-ChildItem $dirs -Recurse -Force -File | Measure-Object Length -Sum).Sum Ok ('Cleared {0:N0} MB of temp files' -f (($before - $after) / 1MB)) ipconfig /flushdns | Out-Null Ok 'DNS cache flushed' # 6. Show what's still eating memory Write-Host "`n Biggest apps still running (close any you don't need):" -ForegroundColor DarkGray Get-Process | Where-Object { $_.MainWindowTitle -and $_.Name -notmatch 'VALORANT|Riot|explorer|powershell|WindowsTerminal|cmd' } | Sort-Object WorkingSet64 -Descending | Select-Object -First 5 | ForEach-Object { Say ('{0,-28} {1,6:N0} MB' -f $_.Name, ($_.WorkingSet64 / 1MB)) } # 7. Launch VALORANT $riot = 'C:\Riot Games\Riot Client\RiotClientServices.exe' $cfg = 'C:\ProgramData\Riot Games\RiotClientInstalls.json' if (Test-Path $cfg) { $j = Get-Content $cfg -Raw | ConvertFrom-Json; if ($j.rc_default) { $riot = $j.rc_default } } Write-Host "`n Done. Reboot once after the first run so GPU scheduling kicks in." -ForegroundColor Cyan if (-not (Get-Process -Name 'VALORANT-Win64-Shipping' -ErrorAction SilentlyContinue) -and (Test-Path $riot)) { Start-Process $riot -ArgumentList '--launch-product=valorant', '--launch-patchline=live' Ok 'Launching VALORANT' } Finish 10 }