explaingit

suganth-s-39/temp-cleaner

14PythonAudience · generalComplexity · 1/5ActiveSetup · easy

TLDR

A small Python script for Windows that clears C:\Windows\Temp and the per-user %TEMP% folder, skipping files currently locked by other programs.

Mindmap

mindmap
  root((Temp Cleaner))
    Inputs
      Windows Temp folder
      User percent TEMP folder
    Outputs
      Deleted temp files
      Recovered disk space
    Use Cases
      Free disk on a Windows PC
      Run as a quick cleanup script
      Bundle as a portable exe
    Tech Stack
      Python
      Windows
      PyInstaller release exe

Things people build with this

USE CASE 1

Reclaim disk space by deleting stale Windows temp files

USE CASE 2

Run a one-line Python cleanup on a personal Windows machine

USE CASE 3

Drop the prebuilt cleaner.exe on a USB stick as a portable cleanup tool

Tech stack

PythonWindows

Getting it running

Difficulty · easy Time to first run · 5min

Run as Administrator so system-owned files in C:\Windows\Temp can actually be removed.

In plain English

Temp Cleaner is a small Python program for Windows whose job is to delete the temporary files that the operating system and many applications leave behind over time. According to the README, it targets two well-known locations: the system-wide C:\Windows\Temp folder and the per-user temporary folder that Windows exposes as the %TEMP% environment variable, which usually maps to AppData\Local\Temp inside a user's profile. Clearing these can recover a bit of disk space. The README is short and the feature list is straightforward. The script cleans both Temp folders, skips any file that is currently locked because another program is using it, and is described as simple and lightweight. There is no scheduling, no GUI, no exclusion list, and no log file mentioned. There are two ways to run the tool. From source, the user runs python cleaner.py in a terminal. There is also a packaged cleaner.exe that can be downloaded from the GitHub Releases page and double-clicked. The author advises running it as Administrator for the best results, since some files in the Windows Temp folder are owned by the system and need elevated permissions to remove. The README is sparse beyond that. It does not mention a licence, supported Windows versions, dependencies, tests, or contribution guidelines. The repository is credited to Suganth S.

Copy-paste prompts

Prompt 1
Show me how to safely extend Temp Cleaner to also clear browser cache folders
Prompt 2
Rewrite cleaner.py to log every deleted file path to a text file in the user home
Prompt 3
Convert this Temp Cleaner script into a scheduled task that runs every Sunday
Prompt 4
Add a dry-run flag to Temp Cleaner that prints what it would delete without removing anything
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.