Skip to content

About

A Windows desktop app that cleans common cache directories

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

Windows Cleaner

CI License: MIT

A Windows desktop app that scans known cache locations, shows how much space each one holds, and moves the ones you pick to the Recycle Bin.

Features

  • A built-in catalog of 123 cleanup targets covering browsers, chat apps, game launchers, developer tools, GPU shader caches, and Windows system caches. To regenerate that count, run cargo test -p cleaner-catalog full_registry_shape, which asserts it.
  • A selection list that groups cleanup targets by category and app, with a size estimate on each target, search, sorting, and collapsible sections.
  • Presets: save the targets you have checked under a name and check them again in one click. Hover a preset, or open Manage presets, to see which of its targets it checks on this scan. Mark one preset to apply at every launch, in place of your last selection.
  • Preview mode by default. Nothing is deleted until you start a clean.
  • Optional removal of empty folders under AppData and ProgramData. Each row shows how many folders it removes, and its details list them.
  • Exclusions, a minimum file age, and a minimum file size, plus an option to skip a target while its program runs.
  • A file list for each target, sortable by path, size, and date, with an Exclude button on each file.
  • A Stop button that ends a cleanup after the item being moved.
  • Badges on targets that need administrator rights, Scan again as administrator, and a setting to always start with them.
  • Settings export and import, for a backup or another PC.
  • Run history with per-run detail and totals for the last 7 and last 30 days.
  • A diagnostics log you can attach to a bug report.

After a scan, each cleanup target that holds data shows its size.

The cleanup target list after a scan, grouped into Browsers, Chat, and Development

Preview lists what a clean would move to the Recycle Bin, and moves nothing.

The preview dialog, listing 29 checked targets and an estimated 11.15 GB

Safety model

Cache cleanup moves each selected top-level path to the Recycle Bin, using IFileOperation with FOFX_RECYCLEONDELETE and FOFX_ADDUNDORECORD. A few folders that Windows and other programs expect to exist, such as Temp, Prefetch, and the Windows Update download folder, stay in place, and the app moves what they hold instead. A progress sink aborts any delete that would not go to the Recycle Bin, and the app counts a path as moved only when the shell reports the item it placed there. There is no fallback to permanent deletion: if the move fails, the path stays. If the shell still deletes an item for good, as it does when the Recycle Bin is turned off for a drive, the app records the item as permanently deleted, counts none of it as freed, and stops the cleanup before anything else is deleted the same way.

Empty-folder cleanup uses a non-recursive directory removal that succeeds only while the folder is still empty. Something can be written into a folder between the scan and the clean, and this closes that window without risking the new file. These folders hold nothing, so they do not go to the Recycle Bin.

Exclusions, a minimum file age, and a minimum file size in Settings decide what a cleanup leaves. The app applies them again as the cleanup runs, so an exclusion added after a scan still holds. A folder that holds an excluded path is never moved whole: the app moves what sits around the exclusion. With an age or size limit, it moves matching files one by one and leaves the folders. Old program versions are always moved whole or not at all.

Every path must sit strictly inside one of the known safe roots: AppData Local and Roaming, ProgramData, your user profile, and the Windows and Program Files trees. The app enforces that check while scanning, and checks it again immediately before each delete. For that second check, it first opens every folder from the safe root down to the path's parent and holds them open until the delete ends. No other program can rename those folders or swap one for a junction in between. It always rejects the roots themselves. It also rejects any path that is a symlink or reparse point, or that is reached through one.

Symlinks and reparse points count as content everywhere else too. The app never follows one, never adds its target to a size estimate, and never treats a folder containing one as empty. Groups that turn out to be empty are never pre-selected, and empty-folder removal stays off until you turn it on. Picking a preset that holds empty-folder rows checks them, and so does a select-all box, because those are your own clicks. The preset marked to apply at launch and your last selection never check them. When any are checked, the cleanup question says how many folders it removes and that they cannot be restored.

Each clean writes a JSON record of what it attempted to the run history.

Install

Download the latest release from the releases page. Unpack win-cleaner-<version>-windows-x86_64.zip and run win-cleaner.exe from the folder inside it. SHA256SUMS beside the archive holds its checksum.

The app runs on Windows 10 and 11, x86-64. It needs the Microsoft Visual C++ Redistributable for x64, which most Windows installations already have. If Windows reports that VCRUNTIME140.dll was not found, install the latest supported redistributable.

Updates

The app checks this repository's GitHub releases for a new version each time it starts. To check less often, or never, open About Windows Cleaner > App updates. A check is one request to the GitHub API, and it sends nothing about you or your files.

When a new version is out, a chip in the header names it. Click the chip to read the notes of every release since yours, then choose Download update, Skip this version, or Not now. The download must match both the release's SHA256SUMS and the SHA-256 that GitHub records for the file. Restart to update moves the new win-cleaner.exe into place and reopens the app. It waits while a scan or cleanup runs. The replaced executable stays beside it as win-cleaner.exe.old until the next start.

The install needs write access to the app's folder. If the app lives somewhere it cannot write, such as Program Files, download the new release by hand instead.

Diagnostics

The app writes logs to %LOCALAPPDATA%\win-cleaner\logs\ and run history to %LOCALAPPDATA%\win-cleaner\stats\. If something fails, attach the newest log file to your issue.

Development

The portable logic (catalog, scanning, planning, execution strategy, and statistics) builds and tests on any OS, including Linux:

cargo fmt --all -- --check
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings

CI runs those three commands on Ubuntu and the last two on Windows. It also runs cargo audit and cargo machete. Only the release workflow builds release binaries. Both workflows come from handsomefox/app-workflows, which the other apps share.

To cross-build the Windows 10/11 x86-64 app from Linux, use cargo-xwin:

cargo xwin build --workspace --release --target x86_64-pc-windows-msvc

The GUI runs on Linux for development work, but a release build disables scanning and cleaning there. A debug build scans the folder that WIN_CLEANER_DEV_ROOT names, laid out like a Windows user profile. Cleaning still needs the Windows Recycle Bin, so it fails on Linux.

The pictures above are taken against a profile this writes, not against anyone's own PC:

cargo run -p cleaner-catalog --example demo_profile -- /tmp/demo
WIN_CLEANER_DEV_ROOT=/tmp/demo cargo run -p cleaner-app

The example fills the cleanup targets of 14 common apps and writes every file sparse, so the sizes the window reports are real while the directory takes almost no disk space.

License

Licensed under the MIT License. Bundled assets keep their own licenses: the Inter typeface under SIL OFL 1.1, and the Phosphor icons under MIT.

About

A Windows desktop app that cleans common cache directories

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages