Skip to content

Instantly share code, notes, and snippets.

@jonanderson10
Last active August 16, 2024 19:30
Show Gist options
  • Save jonanderson10/50b18c49a05491745decf08f42fc592c to your computer and use it in GitHub Desktop.
Save jonanderson10/50b18c49a05491745decf08f42fc592c to your computer and use it in GitHub Desktop.

Windows Deep Clean

Some helpful utilities to really free up some disk space on Windows 11.

Cleanup WinSxS folder:

This removes all old Windows update and component packages (also means you can't uninstall updates)

DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase

Cleanup Docker (Need to run this for Windows and Linux container modes):

Use this to reduce size of the wsl virtual disk.

docker system prune -a --volumes
net stop com.docker.service
taskkill /IM "docker.exe" /F
taskkill /IM "Docker Desktop.exe" /F
wsl --shutdown
((@"
select vdisk file="%LOCALAPPDATA%\Docker\wsl\data\ext4.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk
exit
"@
)|diskpart)
net start com.docker.service
. "C:\Program Files\Docker\Docker\Docker Desktop.exe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment