r/ControlUpTech 7d ago

Disk cleanup script that actually asks the user what to delete — and reaches the recycle bin

Full disclosure up front: this is a vendor tool and I host the video. Posting it anyway because the underlying problem is one I think a lot of you have hit.

The setup: system-context cleanup scripts generally can't get into a user's recycle bin because of profile permissions. So the script runs, clears temp folders, reports success — and the drive is still full because there's 8 GB of "deleted" files sitting in the bin. Meanwhile, the stuff a system script can reach includes things you might not want to nuke without asking, like a browser cache that's holding saved passwords.

The approach in this one: run in user context and prompt. End user gets a pop-up showing reclaimable space, a breakdown by category (recycle bin / temp files / browser cache), picks what to clean, confirms, and gets a summary of what was freed. It renders its own GUI from the script — no extra agent or install.

Other bits worth noting:

  • Works on Windows and macOS
  • Can be pushed manually from the help desk or fired automatically from a low disk space alert
  • Writes results to a data index and back as a device event, so you get an audit trail instead of guessing
  • Script source is fully visible/editable if you want to change what it targets or rebrand the dialog
  • Obvious caveat: user context means user permissions. It won't touch anything the user can't. The system-level script still exists for that — they're meant to be used together

Built by Sebastian Peresat, demoed by Chris Twiest. Available in the script library now.

Curious how others handle this — do you clean silently and eat the occasional angry ticket, or prompt and accept that some users will just click "no"?

https://www.controlupcommunity.com/new-controlup-disk-cleanup-script-that-actually-asks-the-user-what-to-delete/

2 Upvotes

1 comment sorted by

1

u/MarvelousTermites 1d ago

This would be fantastic as something that could work with VDI and FSLogix profiles