FakeHacker.bat
A goofy prank batch file that makes your screen look like you're actively hacking into something.
View details →This page contains fun scripts and tools I've created or straight up snatched from other great developers.
Click any card below to open its details and setup guidance.
A goofy prank batch file that makes your screen look like you're actively hacking into something.
View details →Releases, renews, and flushes your network config in one go — handy when the internet's acting up.
View details →A ready-to-use list of BitTorrent trackers that can boost a slow or poorly-seeded torrent's speed.
View details →A lesser-known trick for weak upload/download speeds — lock down background traffic to kill random lag spikes.
View details →A free, layered toolkit for cleaning up an infected Windows machine, step by step.
View details →Turns any folder into an instant local HTTP file server via a right-click menu — no cloud upload needed.
View details →A community-trusted, all-in-one toolkit for debloating, tweaking, and configuring a fresh Windows install — one PowerShell command away.
View details →A hypnotic, color-cycling wave that drifts across your console — pure PowerShell and ANSI escape codes, no dependencies.
View details →A collection of safe, reversible tweaks for a bit of extra framerate — one click to apply, one click to revert, backed up automatically before anything changes.
View details →A harmless prank script for messing with friends. It paints the console green and loops a directory listing so it looks like something intense is happening on screen — no actual hacking involved.
@echo off
color 0a
:redo
tree
dir /s
goto redo
FakeHacker.bat (choose "All Files" as the type so it doesn't save as .txt).Some antivirus tools flag unfamiliar .bat files by default — that's expected for any script you write yourself, not a sign anything is wrong.
Releases your current IP, renews it, and flushes the local DNS cache in one pass. Useful when a connection is misbehaving and you want a clean network reset without rebooting.
@echo off
ipconfig /release
ipconfig /renew
ipconfig /flushdns
pause >nul
IpConfigFlush.bat (choose "All Files" as the type).pause line.A list of public BitTorrent tracker announce URLs. Trackers help your torrent client find more peers to connect to — adding a big batch of them to a slow or poorly-seeded torrent can noticeably speed up downloads and uploads.
Exact menu names vary between torrent clients, but virtually every mainstream client has some form of "add/edit trackers" feature.
Use at your own risk. We accept no liability for unlawful use of this content.
udp://public.popcorn-tracker.org:6969/announce
http://104.28.1.30:8080/announce
http://104.28.16.69/announce
http://107.150.14.110:6969/announce
http://109.121.134.121:1337/announce
http://114.55.113.60:6969/announce
http://125.227.35.196:6969/announce
http://128.199.70.66:5944/announce
http://157.7.202.64:8080/announce
http://158.69.146.212:7777/announce
http://173.254.204.71:1096/announce
http://178.175.143.27/announce
http://178.33.73.26:2710/announce
http://182.176.139.129:6969/announce
http://185.5.97.139:8089/announce
http://188.165.253.109:1337/announce
http://194.106.216.222/announce
http://195.123.209.37:1337/announce
http://210.244.71.25:6969/announce
http://210.244.71.26:6969/announce
http://213.159.215.198:6970/announce
http://213.163.67.56:1337/announce
http://37.19.5.139:6969/announce
http://37.19.5.155:6881/announce
http://46.4.109.148:6969/announce
http://5.79.249.77:6969/announce
http://5.79.83.193:2710/announce
http://51.254.244.161:6969/announce
http://59.36.96.77:6969/announce
http://74.82.52.209:6969/announce
http://80.246.243.18:6969/announce
http://81.200.2.231/announce
http://85.17.19.180/announce
http://87.248.186.252:8080/announce
http://87.253.152.137/announce
http://91.216.110.47/announce
http://91.217.91.21:3218/announce
http://91.218.230.81:6969/announce
http://93.92.64.5/announce
http://atrack.pow7.com/announce
http://bt.henbt.com:2710/announce
http://bt.pusacg.org:8080/announce
http://bt2.careland.com.cn:6969/announce
http://explodie.org:6969/announce
http://mgtracker.org:2710/announce
http://mgtracker.org:6969/announce
http://open.acgtracker.com:1096/announce
http://open.lolicon.eu:7777/announce
http://open.touki.ru/announce.php
http://p4p.arenabg.ch:1337/announce
http://p4p.arenabg.com:1337/announce
http://pow7.com:80/announce
http://retracker.gorcomnet.ru/announce
http://retracker.krs-ix.ru/announce
http://retracker.krs-ix.ru:80/announce
http://secure.pow7.com/announce
http://t1.pow7.com/announce
http://t2.pow7.com/announce
http://thetracker.org:80/announce
http://torrent.gresille.org/announce
http://torrentsmd.com:8080/announce
http://tracker.aletorrenty.pl:2710/announce
http://tracker.baravik.org:6970/announce
http://tracker.bittor.pw:1337/announce
http://tracker.bittorrent.am/announce
http://tracker.calculate.ru:6969/announce
http://tracker.dler.org:6969/announce
http://tracker.dutchtracking.com/announce
http://tracker.dutchtracking.com:80/announce
http://tracker.dutchtracking.nl/announce
http://tracker.dutchtracking.nl:80/announce
http://tracker.edoardocolombo.eu:6969/announce
http://tracker.ex.ua/announce
http://tracker.ex.ua:80/announce
http://tracker.filetracker.pl:8089/announce
http://tracker.flashtorrents.org:6969/announce
http://tracker.grepler.com:6969/announce
http://tracker.internetwarriors.net:1337/announce
http://tracker.kicks-ass.net/announce
http://tracker.kicks-ass.net:80/announce
http://tracker.kuroy.me:5944/announce
http://tracker.mg64.net:6881/announce
http://tracker.opentrackr.org:1337/announce
http://tracker.skyts.net:6969/announce
http://tracker.tfile.me/announce
http://tracker.tiny-vps.com:6969/announce
http://tracker.tvunderground.org.ru:3218/announce
http://tracker.yoshi210.com:6969/announce
http://tracker1.wasabii.com.tw:6969/announce
http://tracker2.itzmx.com:6961/announce
http://tracker2.wasabii.com.tw:6969/announce
http://www.wareztorrent.com/announce
http://www.wareztorrent.com:80/announce
https://104.28.17.69/announce
https://www.wareztorrent.com/announce
udp://107.150.14.110:6969/announce
udp://109.121.134.121:1337/announce
udp://114.55.113.60:6969/announce
udp://128.199.70.66:5944/announce
udp://151.80.120.114:2710/announce
udp://168.235.67.63:6969/announce
udp://178.33.73.26:2710/announce
udp://182.176.139.129:6969/announce
udp://185.5.97.139:8089/announce
udp://185.86.149.205:1337/announce
udp://188.165.253.109:1337/announce
udp://191.101.229.236:1337/announce
udp://194.106.216.222:80/announce
udp://195.123.209.37:1337/announce
udp://195.123.209.40:80/announce
udp://208.67.16.113:8000/announce
udp://213.163.67.56:1337/announce
udp://37.19.5.155:2710/announce
udp://46.4.109.148:6969/announce
udp://5.79.249.77:6969/announce
udp://5.79.83.193:6969/announce
udp://51.254.244.161:6969/announce
udp://62.138.0.158:6969/announce
udp://62.212.85.66:2710/announce
udp://74.82.52.209:6969/announce
udp://85.17.19.180:80/announce
udp://89.234.156.205:80/announce
udp://9.rarbg.com:2710/announce
udp://9.rarbg.me:2780/announce
udp://9.rarbg.to:2730/announce
udp://91.218.230.81:6969/announce
udp://94.23.183.33:6969/announce
udp://bt.xxx-tracker.com:2710/announce
udp://eddie4.nl:6969/announce
udp://explodie.org:6969/announce
udp://mgtracker.org:2710/announce
udp://open.stealth.si:80/announce
udp://p4p.arenabg.com:1337/announce
udp://shadowshq.eddie4.nl:6969/announce
udp://shadowshq.yi.org:6969/announce
udp://torrent.gresille.org:80/announce
udp://tracker.aletorrenty.pl:2710/announce
udp://tracker.bittor.pw:1337/announce
udp://tracker.coppersurfer.tk:6969/announce
udp://tracker.eddie4.nl:6969/announce
udp://tracker.ex.ua:80/announce
udp://tracker.filetracker.pl:8089/announce
udp://tracker.flashtorrents.org:6969/announce
udp://tracker.grepler.com:6969/announce
udp://tracker.ilibr.org:80/announce
udp://tracker.internetwarriors.net:1337/announce
udp://tracker.kicks-ass.net:80/announce
udp://tracker.kuroy.me:5944/announce
udp://tracker.leechers-paradise.org:6969/announce
udp://tracker.mg64.net:2710/announce
udp://tracker.mg64.net:6969/announce
udp://tracker.opentrackr.org:1337/announce
udp://tracker.piratepublic.com:1337/announce
udp://tracker.sktorrent.net:6969/announce
udp://tracker.skyts.net:6969/announce
udp://tracker.tiny-vps.com:6969/announce
udp://tracker.yoshi210.com:6969/announce
udp://tracker2.indowebster.com:6969/announce
udp://tracker4.piratux.com:6969/announce
udp://zer0day.ch:1337/announce
udp://zer0day.to:1337/announce
A trick not widely talked about, but one that can help a lot of gamers with weak download/upload speeds: lock your firewall down so only the game itself can talk to the internet.
I used to have bad internet — a single feedback log silently sent to Microsoft in the background would spike my ping while playing League of Legends. So I started blocking all incoming and outgoing traffic by default, and only allowed the applications actually needed for the game to run.
The result was promising. Applications that would normally send out analytics data in the background could no longer do so, which meant a more stable gameplay experience without the constant lag spikes that used to hit at totally random moments.
A free, layered pass for cleaning up an infected Windows machine. Run these roughly in order — each one catches things the others miss.
Run this first if you suspect active malware. It terminates known malicious processes so the scanners below can actually delete their files — some malware blocks AV tools from running or deleting while it's active.
Run this next — it specifically targets adware, browser hijackers, PUPs (potentially unwanted programs), and junk toolbars that regular AV tools sometimes miss or don't prioritize. Free, no real-time protection needed, just a one-off scan and clean.
Catches malware, trojans, PUPs, and some things Defender misses, especially newer or less signature-based threats. The free version is on-demand scan only, no real-time protection — that's fine for a cleanup pass.
Built-in and free, normally runs real-time protection, but for stubborn infections use Defender's Offline Scan (boots into a minimal pre-OS environment). This catches rootkits and things that hide themselves while Windows is running.
Free, no-install, secondary-opinion scanners that are good at catching things one AV engine missed. Use one as a "third opinion" pass.
Turns any folder into an instant local HTTP file server. Shift+Right-click
a folder's empty space and choose "Host server here" to serve it at
http://localhost:8000/ — handy for grabbing a file from
another PC or phone on the same network without touching the cloud.
"Close hosted directory server" stops it again.
The netsh command below opens port 8000 to your
entire local network, not just this PC — any device on the same
Wi-Fi/LAN can browse and download from the hosted folder while
it's running, with no login required. Don't run it on a public
or untrusted network, and use "Close hosted directory server"
when you're done.
Write every file yourself and wire it up by hand.
C:\Scripts.C:\Scripts\http-server-native.ps1 — this is the server itself.param(
[string]$Dir = (Get-Location).Path,
[int]$Port = 8000
)
$listener = New-Object System.Net.HttpListener
$listener.Prefixes.Add("http://+:$Port/")
$listener.Start()
$mimeTypes = @{
".html"="text/html"; ".htm"="text/html"; ".css"="text/css"; ".js"="application/javascript"
".json"="application/json"; ".png"="image/png"; ".jpg"="image/jpeg"; ".jpeg"="image/jpeg"
".gif"="image/gif"; ".svg"="image/svg+xml"; ".txt"="text/plain"; ".pdf"="application/pdf"
".zip"="application/zip"; ".apk"="application/vnd.android.package-archive"
".mp4"="video/mp4"; ".mp3"="audio/mpeg"; ".ico"="image/x-icon"
}
$baseFull = [System.IO.Path]::GetFullPath($Dir)
while ($listener.IsListening) {
$context = $listener.GetContext()
$request = $context.Request
$response = $context.Response
try {
$reqPath = [Uri]::UnescapeDataString($request.Url.AbsolutePath.TrimStart('/'))
$fullPath = [System.IO.Path]::GetFullPath((Join-Path $baseFull $reqPath))
if (-not $fullPath.StartsWith($baseFull)) {
$response.StatusCode = 403
$response.Close()
continue
}
if (Test-Path $fullPath -PathType Container) {
$items = Get-ChildItem $fullPath
$html = "<html><body><h2>Index of /$reqPath</h2><ul>"
if ($reqPath -ne "") { $html += "<li><a href='../'>../</a></li>" }
foreach ($item in $items) {
$name = $item.Name
if ($item.PSIsContainer) { $name += "/" }
$html += "<li><a href='$name'>$name</a></li>"
}
$html += "</ul></body></html>"
$buffer = [Text.Encoding]::UTF8.GetBytes($html)
$response.ContentType = "text/html"
$response.ContentLength64 = $buffer.Length
$response.OutputStream.Write($buffer, 0, $buffer.Length)
}
elseif (Test-Path $fullPath -PathType Leaf) {
$ext = [System.IO.Path]::GetExtension($fullPath).ToLower()
$contentType = $mimeTypes[$ext]
if (-not $contentType) { $contentType = "application/octet-stream" }
$bytes = [System.IO.File]::ReadAllBytes($fullPath)
$response.ContentType = $contentType
$response.ContentLength64 = $bytes.Length
$response.OutputStream.Write($bytes, 0, $bytes.Length)
}
else {
$response.StatusCode = 404
$msg = [Text.Encoding]::UTF8.GetBytes("404 Not Found")
$response.OutputStream.Write($msg, 0, $msg.Length)
}
}
catch {
try { $response.StatusCode = 500 } catch {}
}
finally {
$response.Close()
}
}
C:\Scripts\host-server-hidden.ps1 — it's what the right-click menu actually launches.param([string]$Dir)
Start-Process powershell.exe -ArgumentList @(
"-NoProfile","-ExecutionPolicy","Bypass","-WindowStyle","Hidden",
"-File","C:\Scripts\http-server-native.ps1","-Dir","$Dir","-Port","8000"
) -WindowStyle Hidden
windows-server-context-menu.reg,
then double-click it and confirm the import prompt.
Windows Registry Editor Version 5.00
; Shift+Right-click in a folder's empty space -> "Host server here" (fully silent, PowerShell-native)
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\HostServerHere]
@="Host server here"
"Extended"=""
"Icon"="C:\\Windows\\System32\\cmd.exe,0"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\HostServerHere\command]
@="conhost.exe --headless powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File \"C:\\Scripts\\host-server-hidden.ps1\" %V"
; Shift+Right-click in a folder's empty space -> "Close hosted directory server"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\StopHostedServers]
@="Close hosted directory server"
"Extended"=""
"Icon"="C:\\Windows\\System32\\cmd.exe,0"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\StopHostedServers\command]
@="powershell.exe -NoProfile -WindowStyle Hidden -Command \"Get-CimInstance Win32_Process | Where-Object { $_.Name -eq 'powershell.exe' -and $_.CommandLine -match 'http-server-native.ps1' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }\""
netsh http add urlacl url=http://+:8000/ user=Everyone
This step is required for both manual setups — without it the
listener has no permission to bind to the port and the server
won't start.
Download the prewritten files and set them up yourself.
C:\Scripts and copy both downloaded .ps1 files into it.windows-server-context-menu.reg and confirm the prompt to import it.netsh http add urlacl url=http://+:8000/ user=Everyone
This step is required for both manual setups — without it the
listener has no permission to bind to the port and the server
won't start.
Once the server is running on the hosting PC, any device on the same network — phone, laptop, tablet — can reach it and download files, no cloud or cable needed.
ipconfig
IPv4 Address, e.g. 192.168.1.42.
http://<IPv4>:8000/ — for example
http://192.168.1.42:8000/.
If the page doesn't load, double-check both devices are on the same network and that the server is still running — "Close hosted directory server" stops it, and it needs to be started again with "Host server here."
WinUtil is a well-known, open-source Windows toolkit that bundles app installs, debloating tweaks, troubleshooting configs, and Windows Update controls into one menu-driven tool. It's built by Chris Titus Tech and run directly from his own domain — nothing hosted here, nothing to download from me.
irm https://christitus.com/win | iex
It needs admin rights because it makes system-wide changes — review what you're selecting before applying it, same as with any tweak tool.
A single glowing block drifts left and right across your terminal, cycling smoothly through color as it goes — the color and the horizontal position are both driven by offset sine waves, so it never quite repeats the same way twice. It's just PowerShell and raw ANSI escape codes, so it runs anywhere PowerShell does.
$i = 0
$e = [char]27
function Calc($Offset, $Speed)
{
$base = ($i / $Speed) + (2 * [Math]::Pi * ($Offset / 3))
return (([Math]::Sin($base)) + 1) / 2
}
while ($true)
{
$i++
$r = [int]((Calc 1 50) * 255)
$g = [int]((Calc 2 50) * 255)
$b = [int]((Calc 3 50) * 255)
$dotSize = 10
$dot = ([string][char]0x2588) * $dotSize
$offset = " " * [int]((Calc 1 20) * ([Console]::BufferWidth - $dotSize))
$colorDot = "$e[38;2;$r;$g;$($b)m$dot$e[0m"
Write-Host ($offset + $colorDot)
sleep -Milliseconds 5
}
WaveTerminal.ps1 (choose "All Files" as the type so it doesn't save as .txt)..\WaveTerminal.ps1 — if it's blocked by execution
policy, run
powershell -ExecutionPolicy Bypass -File .\WaveTerminal.ps1
instead.
Widen your terminal window before running it — the wave travels the full width of the console buffer, so a wider window makes for a longer, smoother sweep.
A small toolkit for squeezing out a bit of extra framerate: an Ultimate Performance power plan, SysMain (Superfetch) disabled, Xbox Game Bar / Game DVR disabled, visual effects set to best performance, and Delivery Optimization's peer-to-peer downloads turned off. You can apply each one manually (asked one by one) or all at once.
The first time it runs, it snapshots your current settings to
before-tool-settings.json in the same folder — run it
again afterward and it'll offer to revert everything back to
exactly how it was, tweak by tweak.
C:\Scripts\WinOptimizer.win-optimizer.bat in that folder (choose "All
Files" as the type).
@echo off
:: Windows Performance Optimizer launcher
:: Self-elevates to admin, then runs win-optimizer.ps1 in the same folder.
net session >nul 2>&1
if %errorLevel% == 0 (
goto gotAdmin
) else (
echo Requesting administrative privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
:gotAdmin
cd /d "%~dp0"
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0win-optimizer.ps1"
echo.
pause
win-optimizer.ps1 in the same folder.
#Requires -RunAsAdministrator
# ============================================================
# Windows Performance Optimizer
# Applies 5 safe, reversible performance tweaks.
# Every change is backed up to before-tool-settings.json
# the FIRST time you run this, and every optimization
# can be reverted back to its original value later.
# ============================================================
$ErrorActionPreference = 'Stop'
$backupPath = Join-Path $PSScriptRoot "before-tool-settings.json"
# ---------- generic registry helpers ----------
function Get-RegValue($path, $name) {
try { return (Get-ItemProperty -Path $path -Name $name -ErrorAction Stop).$name }
catch { return $null }
}
function Set-RegValue($path, $name, $value, $type = 'DWord') {
if (-not (Test-Path $path)) { New-Item -Path $path -Force | Out-Null }
New-ItemProperty -Path $path -Name $name -Value $value -PropertyType $type -Force | Out-Null
}
function Remove-RegValue($path, $name) {
if (Test-Path $path) { Remove-ItemProperty -Path $path -Name $name -ErrorAction SilentlyContinue }
}
# ---------- optimization list (order = display order) ----------
$OptList = @(
[PSCustomObject]@{ Id = 'PowerPlan'; Name = 'Ultimate Performance power plan' }
[PSCustomObject]@{ Id = 'SysMain'; Name = 'SysMain (Superfetch) service' }
[PSCustomObject]@{ Id = 'GameBar'; Name = 'Xbox Game Bar / Game DVR' }
[PSCustomObject]@{ Id = 'VisualEffects'; Name = 'Visual effects (best performance)' }
[PSCustomObject]@{ Id = 'DeliveryOpt'; Name = 'Delivery Optimization (peer downloads)' }
)
# ============================================================
# BACKUP (capture current state)
# ============================================================
function Backup-Setting($id) {
switch ($id) {
'PowerPlan' {
$active = powercfg /getactivescheme
if ($active -match '([0-9a-fA-F-]{36})') { return $matches[1] }
return $null
}
'SysMain' {
$svc = Get-Service -Name SysMain -ErrorAction SilentlyContinue
if (-not $svc) { return $null }
return @{ StartType = $svc.StartType.ToString(); WasRunning = ($svc.Status -eq 'Running') }
}
'GameBar' {
return @{
GameDVR_Enabled = Get-RegValue 'HKCU:\System\GameConfigStore' 'GameDVR_Enabled'
AppCaptureEnabled = Get-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR' 'AppCaptureEnabled'
AllowGameDVR = Get-RegValue 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR' 'AllowGameDVR'
}
}
'VisualEffects' {
return @{
VisualFXSetting = Get-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects' 'VisualFXSetting'
DragFullWindows = Get-RegValue 'HKCU:\Control Panel\Desktop' 'DragFullWindows'
MinAnimate = Get-RegValue 'HKCU:\Control Panel\Desktop\WindowMetrics' 'MinAnimate'
TaskbarAnimations = Get-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'TaskbarAnimations'
ListviewShadow = Get-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'ListviewShadow'
ListviewAlphaSelect = Get-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'ListviewAlphaSelect'
}
}
'DeliveryOpt' {
return Get-RegValue 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config' 'DODownloadMode'
}
}
}
# ============================================================
# APPLY
# ============================================================
function Apply-Setting($id) {
switch ($id) {
'PowerPlan' {
$ultimateSrc = 'e9a42b02-d5df-448d-aa00-03f14749eb61'
$list = powercfg /list
$existingLine = $list | Select-String 'Ultimate Performance'
if ($existingLine -and $existingLine.Line -match '([0-9a-fA-F-]{36})') {
$targetGuid = $matches[1]
} else {
$dupOut = powercfg /duplicatescheme $ultimateSrc
if ($dupOut -match '([0-9a-fA-F-]{36})') { $targetGuid = $matches[1] }
}
if ($targetGuid) { powercfg /setactive $targetGuid | Out-Null }
}
'SysMain' {
Stop-Service -Name SysMain -Force -ErrorAction SilentlyContinue
Set-Service -Name SysMain -StartupType Disabled -ErrorAction SilentlyContinue
}
'GameBar' {
Set-RegValue 'HKCU:\System\GameConfigStore' 'GameDVR_Enabled' 0
Set-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR' 'AppCaptureEnabled' 0
Set-RegValue 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR' 'AllowGameDVR' 0
}
'VisualEffects' {
Set-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects' 'VisualFXSetting' 2
Set-RegValue 'HKCU:\Control Panel\Desktop' 'DragFullWindows' '0' 'String'
Set-RegValue 'HKCU:\Control Panel\Desktop\WindowMetrics' 'MinAnimate' '0' 'String'
Set-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'TaskbarAnimations' 0
Set-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'ListviewShadow' 0
Set-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'ListviewAlphaSelect' 0
Write-Host " (sign out or restart Explorer for visual changes to fully apply)" -ForegroundColor DarkGray
}
'DeliveryOpt' {
Set-RegValue 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config' 'DODownloadMode' 0
}
}
}
# ============================================================
# REVERT
# ============================================================
function Revert-Setting($id, $value) {
switch ($id) {
'PowerPlan' {
if ($value) { powercfg /setactive $value | Out-Null }
}
'SysMain' {
if ($null -eq $value) { return }
Set-Service -Name SysMain -StartupType $value.StartType -ErrorAction SilentlyContinue
if ($value.WasRunning) { Start-Service -Name SysMain -ErrorAction SilentlyContinue }
}
'GameBar' {
if ($null -eq $value.GameDVR_Enabled) { Remove-RegValue 'HKCU:\System\GameConfigStore' 'GameDVR_Enabled' }
else { Set-RegValue 'HKCU:\System\GameConfigStore' 'GameDVR_Enabled' $value.GameDVR_Enabled }
if ($null -eq $value.AppCaptureEnabled) { Remove-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR' 'AppCaptureEnabled' }
else { Set-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR' 'AppCaptureEnabled' $value.AppCaptureEnabled }
if ($null -eq $value.AllowGameDVR) { Remove-RegValue 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR' 'AllowGameDVR' }
else { Set-RegValue 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR' 'AllowGameDVR' $value.AllowGameDVR }
}
'VisualEffects' {
if ($null -eq $value.VisualFXSetting) { Remove-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects' 'VisualFXSetting' }
else { Set-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects' 'VisualFXSetting' $value.VisualFXSetting }
if ($null -eq $value.DragFullWindows) { Remove-RegValue 'HKCU:\Control Panel\Desktop' 'DragFullWindows' }
else { Set-RegValue 'HKCU:\Control Panel\Desktop' 'DragFullWindows' $value.DragFullWindows 'String' }
if ($null -eq $value.MinAnimate) { Remove-RegValue 'HKCU:\Control Panel\Desktop\WindowMetrics' 'MinAnimate' }
else { Set-RegValue 'HKCU:\Control Panel\Desktop\WindowMetrics' 'MinAnimate' $value.MinAnimate 'String' }
if ($null -eq $value.TaskbarAnimations) { Remove-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'TaskbarAnimations' }
else { Set-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'TaskbarAnimations' $value.TaskbarAnimations }
if ($null -eq $value.ListviewShadow) { Remove-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'ListviewShadow' }
else { Set-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'ListviewShadow' $value.ListviewShadow }
if ($null -eq $value.ListviewAlphaSelect) { Remove-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'ListviewAlphaSelect' }
else { Set-RegValue 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'ListviewAlphaSelect' $value.ListviewAlphaSelect }
Write-Host " (sign out or restart Explorer for visual changes to fully apply)" -ForegroundColor DarkGray
}
'DeliveryOpt' {
if ($null -eq $value) { Remove-RegValue 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config' 'DODownloadMode' }
else { Set-RegValue 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config' 'DODownloadMode' $value }
}
}
}
# ============================================================
# UI helpers
# ============================================================
function Ask-Choice($prompt, $options) {
Write-Host ""
Write-Host $prompt -ForegroundColor Cyan
for ($i = 0; $i -lt $options.Count; $i++) {
Write-Host " [$($i+1)] $($options[$i])"
}
do {
$raw = Read-Host "Enter choice number"
$ok = $raw -match '^\d+$' -and [int]$raw -ge 1 -and [int]$raw -le $options.Count
if (-not $ok) { Write-Host "Invalid choice, try again." -ForegroundColor Red }
} while (-not $ok)
return [int]$raw
}
function Ask-YesNo($prompt) {
do {
$raw = Read-Host "$prompt [Y]es / [N]o"
} while ($raw -notmatch '^[YyNn]$')
return ($raw -match '^[Yy]$')
}
# ============================================================
# MAIN
# ============================================================
Write-Host "=============================================="
Write-Host " Windows Performance Optimizer"
Write-Host "=============================================="
$mode = $null # 'apply' or 'revert'
$backup = $null
if (Test-Path $backupPath) {
$backup = Get-Content $backupPath -Raw | ConvertFrom-Json
$choice = Ask-Choice "A backup already exists from a previous run. What do you want to do?" @('Apply optimizations', 'Revert to original settings')
$mode = if ($choice -eq 1) { 'apply' } else { 'revert' }
} else {
Write-Host ""
Write-Host "No backup found - capturing your current settings first..." -ForegroundColor Yellow
$snapshot = [ordered]@{}
foreach ($opt in $OptList) { $snapshot[$opt.Id] = Backup-Setting $opt.Id }
$snapshot | ConvertTo-Json -Depth 6 | Set-Content -Path $backupPath -Encoding UTF8
Write-Host "Backup saved to: $backupPath" -ForegroundColor Green
$backup = Get-Content $backupPath -Raw | ConvertFrom-Json
$mode = 'apply'
}
$howChoice = Ask-Choice "Do you wish to apply each optimization manually (one by one) or automatically (all at once)?" @('Manually', 'Automatically')
$manual = ($howChoice -eq 1)
Write-Host ""
if ($mode -eq 'apply') {
Write-Host "Applying optimizations..." -ForegroundColor Cyan
foreach ($opt in $OptList) {
$doIt = $true
if ($manual) { $doIt = Ask-YesNo "Apply '$($opt.Name)'?" }
if ($doIt) {
try {
Apply-Setting $opt.Id
Write-Host " [OK] $($opt.Name)" -ForegroundColor Green
} catch {
Write-Host " [FAILED] $($opt.Name) - $($_.Exception.Message)" -ForegroundColor Red
}
} else {
Write-Host " [SKIPPED] $($opt.Name)" -ForegroundColor DarkGray
}
}
} else {
Write-Host "Reverting to original settings..." -ForegroundColor Cyan
foreach ($opt in $OptList) {
$doIt = $true
if ($manual) { $doIt = Ask-YesNo "Revert '$($opt.Name)'?" }
if ($doIt) {
try {
Revert-Setting $opt.Id $backup.($opt.Id)
Write-Host " [OK] $($opt.Name)" -ForegroundColor Green
} catch {
Write-Host " [FAILED] $($opt.Name) - $($_.Exception.Message)" -ForegroundColor Red
}
} else {
Write-Host " [SKIPPED] $($opt.Name)" -ForegroundColor DarkGray
}
}
}
Write-Host ""
Write-Host "Done. Some changes (visual effects, Explorer-related) may need a sign-out or restart to fully take effect." -ForegroundColor Yellow
win-optimizer.bat — it'll prompt for admin rights, then walk you through applying (or later reverting) each tweak.Since you're creating both files yourself instead of downloading them, there's no SmartScreen warning or "unblock file" step — Windows only flags files it knows came from the internet.