The "fix everything" combo

Run from an elevated PowerShell prompt. Order matters — DISM repairs the component store that SFC reads from.

# 1. Repair the component store using Windows Update as the source
DISM /Online /Cleanup-Image /RestoreHealth

# 2. Verify and repair protected system files
sfc /scannow

# 3. Reset the Windows Store / app installer
wsreset.exe

# 4. Re-register the built-in app packages (fixes broken Start menu, broken Settings)
Get-AppxPackage -AllUsers | ForEach-Object {
    Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml" -ErrorAction SilentlyContinue
}

Reboot. About 80% of "Windows is acting weird" symptoms are gone. If they're not, this is the point at which I usually consider an in-place upgrade (running setup.exe from a downloaded ISO — preserves apps and files, replaces the OS layer underneath).

Useful one-line PowerShell tweaks

Enable long file paths (>260 characters)

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
    -Name "LongPathsEnabled" -Value 1 -PropertyType DWord -Force

Required by some development tools (Yarn, Maven, Gradle, .NET) when paths get deep. The setting is system-wide and only takes effect for processes that opt in via their manifest — modern developer tools usually do.

Disable memory compression (trade RAM for latency)

Disable-MMAgent -MemoryCompression

Windows 10/11's memory compressor saves RAM by compressing cold pages but pays for it in CPU time on uncompress. On a machine with plenty of RAM and a workload sensitive to latency spikes (audio production, gaming), turning it off is worth a few hundred MB of memory. Re-enable with Enable-MMAgent -MemoryCompression.

Clear the Event Viewer log

wevtutil el | ForEach-Object { wevtutil cl "$_" }

Useful before triaging a problem: clear the logs, reproduce, look at what's new. The default Event Log size is large enough that this is rarely necessary, but it's good to have.

Enable the Windows "Open With" context menu when it's gone missing

reg add "HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Open With" /ve /t REG_SZ `
    /d "{09799AFB-AD67-11d1-ABCD-00C04FC30936}" /f

WiFi ping spike fix on Windows 11/10

Windows periodically scans for new networks even while connected, which can spike ping by 30–100ms every few seconds. To stop the scan-while-connected behaviour:

netsh wlan set autoconfig enabled=no interface="Wi-Fi"

Re-enable when you actually want to roam between networks again:

netsh wlan set autoconfig enabled=yes interface="Wi-Fi"

Decrapification

For removing pre-installed bloatware (Candy Crush, Xbox apps you don't use, etc.), I've used Windows10Debloater in the past. It still works on Windows 11. Read the script before you run it — some of the things it removes (e.g. Cortana, OneDrive) might be things you actually use.

Same goes for any "tweaker" tool. Be paranoid: open the script, see what it actually changes, run it under RegShot or Procmon if you want to know exactly what's been touched.

Cleaning up disk space

The built-in tools handle this fine, no third-party utility needed:

# Disk Cleanup with all advanced options
cleanmgr /sageset:65535 && cleanmgr /sagerun:65535

# Clean component store of old superseded packages (can free 5+ GB on a 5-year-old install)
DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase
About the original ZIP from this post

The Tweak_Scripts.zip bundle the old version of this article linked to is no longer hosted. I don't recommend running random tweak scripts from the internet anyway — the recipes above cover everything that ZIP did, and you can read every line before you run it.