System Cleaner is a Windows PowerShell cleanup utility built as a console-style application. It focuses on disposable data such as temp files, browser caches, shader caches, update-download leftovers, and selected app caches, while deliberately avoiding common personal folders such as Downloads.
The project stays intentionally small:
- One main script:
SystemCleaner.ps1 - One operator experience: interactive menu or direct CLI mode
- One design goal: visible, reviewable cleanup behavior with conservative defaults
The cleaner targets well-known disposable locations, including:
- User temp folders and
%LOCALAPPDATA%\Temp - Windows temp folders
- Windows Error Reporting cache and queue folders
- Windows Update download cache
- Chromium browser caches for Chrome, Edge, and Brave
- Firefox cache directories
- App caches for Discord, VS Code, Spotify, Telegram Desktop, and Stremio
- GPU shader caches
- Windows thumbnail and icon caches
- Recycle Bin contents
- Empty cache-like directories under safe roots
- Stale cache, temp, and log folders inside approved roots
Aggressive mode adds:
Dism.exe /online /Cleanup-Image /StartComponentCleanup- Windows event-log clearing through
wevtutil.exe
The script follows a predictable runtime flow:
- It resolves protected paths and system cleanup roots.
- It checks whether the current PowerShell session is elevated.
- If elevation is required, it relaunches itself through the normal Windows UAC prompt.
- It shows the interactive console menu or runs the selected
-Mode. - It processes cleanup steps in a fixed order and prints live command-style logs.
- It calculates before-and-after disk free space and prints a run summary.
The cleanup pipeline is ordered to keep the operator informed:
- System temp, crash, and update-related caches
- Chromium browser caches
- Firefox caches
- Selected application caches
- GPU, thumbnail, and icon caches
- Recycle Bin
- Empty and stale cache-like folders
- Optional aggressive maintenance tasks
The current console interface is designed to behave like a small terminal application:
- Compact fixed-width ASCII title banner
- Status panel with mode, free space, protected-path summary, last-run recap, and run meter
- ASCII step meter plus spinner-style progress updates during cleanup
- Boxed main menu and post-run actions
- Persistent logs after execution so the user can inspect exactly what happened
- ASCII-only UI elements so Windows PowerShell consoles do not render broken glyphs
This project is designed around scoped cleanup, not broad deletion.
By default, the script does not target:
Downloads- Documents, Desktop, Pictures, Music, or Videos
- Source-code repositories as a general class
- Installed applications
- Registry keys
- Browser profiles as whole directories
- Credentials, passwords, or accounts as direct cleanup targets
- Arbitrary folders outside the approved cleanup roots
Safety controls include:
- Automatic exclusion of
Downloads - Additional protected paths through
-ExtraExcludePath Previewmode for dry-run execution- Visible step-by-step logs
- Narrow targeting of known cache and temporary paths
- Optional aggressive actions instead of default aggressive behavior
Important operational notes:
- Some applications will rebuild caches on next launch.
- Some applications may lose thumbnails, transient sessions, or offline cache data.
Aggressivemode is intentionally more disruptive thanStandard.- Administrator rights are required because some system-owned targets cannot be accessed otherwise.
Menu: interactive console menuStandard: regular cleanup scopeAggressive: standard scope plus component-store cleanup and event-log clearingPreview: dry run with no file deletion
The cleaner primarily operates inside these roots:
%TEMP%%LOCALAPPDATA%%APPDATA%%ProgramData%%SystemRoot%\Temp%SystemRoot%\SoftwareDistribution\Download
Within those areas, it removes named cache, temp, update, crash, and shell-cache data instead of sweeping entire trees blindly.
- Windows
- PowerShell 5.1 or newer
- Permission to approve UAC elevation
Launch the interactive console:
powershell -ExecutionPolicy Bypass -File .\SystemCleaner.ps1Run the standard cleanup directly:
powershell -ExecutionPolicy Bypass -File .\SystemCleaner.ps1 -Mode StandardRun the aggressive cleanup:
powershell -ExecutionPolicy Bypass -File .\SystemCleaner.ps1 -Mode AggressivePreview the cleanup plan without deleting anything:
powershell -ExecutionPolicy Bypass -File .\SystemCleaner.ps1 -Mode PreviewProtect additional paths:
powershell -ExecutionPolicy Bypass -File .\SystemCleaner.ps1 -Mode Preview -ExtraExcludePath 'D:\Backups','E:\PortableApps'Skip the final pause in non-menu runs:
powershell -ExecutionPolicy Bypass -File .\SystemCleaner.ps1 -Mode Standard -NoPauseFor a first-time operator:
- Review
SystemCleaner.ps1. - Run
Previewmode first. - Read the live logs and confirm the scope.
- Add any additional protected paths with
-ExtraExcludePath. - Run
Standardmode. - Use
Aggressivemode only when the heavier maintenance tradeoff is acceptable.
If the tool reopens with a UAC prompt:
- That is expected for system-level cleanup targets.
If some cache folders cannot be removed:
- The owning application may still be running.
- Close the application and rerun the cleaner.
If reported free space changes only slightly:
- The targeted caches may already be small or empty.
- Use
Previewmode to confirm what the script plans to touch.
If an application rebuilds data on next launch:
- That is normal behavior for cache cleanup.
- The project is intentionally kept as a single PowerShell script for inspectability.
- The interface is interactive, but every mode can also be run directly from the CLI.
- Logs are emitted in real time so operators can audit actions during execution.
- The summary section reports duration, before/after free space, and processed cleanup counts.
For security-specific guidance, see SECURITY.md.