Windows · How-To
Disk Cleanup on Windows: Shortcuts, cleanmgr Flags & Freeing Space
This page expands a short post from the original windows-now.com archive; the guide below is present-day Windows Now editorial. For the current, step-by-step way on today's Windows, see our up-to-date guide: How to Free Up Disk Space in Windows 11.
This page expands a brief Kristan Kenney post from the original windows-now.com; the guide below is new, present-day editorial by Windows Now. The original 2007 note explained one specific quirk of Disk Cleanup on 64-bit Windows Vista — we have kept that detail intact and built a full, current guide around it.
Disk Cleanup — the program named cleanmgr.exe — is one of the oldest and most reliable ways
to reclaim space on a Windows drive. It has shipped with Windows for decades, it needs no download, and it
only removes files that Windows classes as safe to delete. This guide covers what it actually does, a
long-standing 32-bit versus 64-bit shortcut nuance, how to put a shortcut on your desktop, the two
command-line flags that let you automate it, which categories are safe to clear, and where Windows is
heading now that Storage Sense has taken over much of the same job.
What Disk Cleanup does
Disk Cleanup scans a drive and groups deletable files into categories — things like temporary internet files, thumbnail caches, the Recycle Bin, error-reporting files, delivery optimisation files, and leftover files from Windows updates. You tick the categories you want to remove, click OK, and it deletes them. It does not touch your documents, applications or settings; everything it offers is either temporary data Windows can regenerate or files the system no longer needs.
You can open it several ways. Search for Disk Cleanup from the Start menu; type
cleanmgr into the Run box (Windows + R) or a command prompt; or open
This PC, right-click a drive, choose Properties, and click the
Disk Cleanup button on the General tab. To also clear system-owned files
such as Windows Update leftovers, use the Clean up system files button inside the tool,
which relaunches it with administrator rights.
The 32-bit vs 64-bit shortcut nuance
This is the detail the original 2007 post addressed, and it is still worth understanding on any 64-bit
version of Windows. A 64-bit Windows install keeps two copies of many built-in tools: the native 64-bit
version lives in the System32 folder, and a 32-bit version lives in the SysWOW64
folder. (The naming is counter-intuitive but correct — on 64-bit Windows, System32 holds the
64-bit files.)
On older 64-bit Windows the Start menu shortcut for Disk Cleanup could point at the 32-bit copy. As the original post put it, Disk Cleanup would "work fine from this shortcut for most things," but one function did not behave correctly — the cleaning of System Restore points and Shadow Copies / Previous Versions. Launching the tool another way, such as the Disk Cleanup button on a drive's Properties window, ran the correct executable, so the problem only showed up when you used that particular shortcut.
The fix from the original guide was simply to repoint the shortcut. For reference, here are those steps, written for Windows Vista:
- Click Start, All Programs, Accessories, and then System Tools.
- Right-click Disk Cleanup and, from the context menu, click Properties.
- Change the Target from
%SystemRoot%\SysWOW64\cleanmgr.exeto%SystemRoot%\system32\cleanmgr.exe. - Click OK. If User Account Control prompts you for consent, click Continue or provide the appropriate credentials.
Current versions of Windows generally launch the correct build of cleanmgr.exe for you,
and the old Accessories → System Tools Start-menu folder no longer exists in the same form. The
principle still holds, though: if you ever build your own shortcut on a 64-bit system and want the full
set of clean-up options, point it at the copy in System32, which is the native 64-bit
build.
How to create a desktop shortcut to Disk Cleanup
If you clean up regularly, a desktop shortcut saves a few clicks each time.
- Right-click an empty area of the desktop and choose New → Shortcut.
- For the location, type
%SystemRoot%\System32\cleanmgr.exeand click Next. - Give the shortcut a name, such as Disk Cleanup, and click Finish.
To have the shortcut always start with administrator rights (so it can offer the system-file categories without an extra click), right-click it, choose Properties, then Advanced, and tick Run as administrator. You can also change the icon from the same Properties dialog if you like.
Automating Disk Cleanup: /sageset and /sagerun
cleanmgr.exe has two documented command-line switches that together let you save a set of
clean-up choices once and then run them repeatedly — including on a schedule — without touching the dialog
each time. The number after the colon is just a label you pick (any value from 0 to 65535); the same number
ties a preset you create to the run command that uses it.
Step 1 — choose your categories once with /sageset
Open an elevated command prompt or the Run box and enter, for example:
cleanmgr /sageset:1
This opens the Disk Cleanup Settings dialog showing the full list of categories, rather than the ones for a single drive. Tick every category you want this preset to clear, then click OK. Nothing is deleted yet — Windows just records your selection under the number you chose (here, 1).
Step 2 — run that preset with /sagerun
Whenever you want to run the saved selection, use the matching number:
cleanmgr /sagerun:1
Disk Cleanup runs silently against the categories you saved, across the eligible drives, without showing
the settings dialog. You can create several presets — /sageset:1 for a light everyday clean,
/sageset:2 for a deeper one, and so on — and run whichever you need.
Run it on a schedule
Because /sagerun is a plain command, you can point Task Scheduler at it to
clean up automatically. Create a new task, set your trigger (for example, weekly), and for the action choose
Start a program with the program set to cleanmgr.exe and the argument set to
/sagerun:1. For unattended runs, configure the task to run whether or not you are logged on and
with highest privileges so it can clear system categories.
Which categories are safe to clear — and which need care
Most of what Disk Cleanup lists is safe to remove. A few items are worth a moment's thought.
Generally safe
- Temporary files and temporary internet files — scratch data applications and browsers leave behind.
- Thumbnails — the cache of preview images; Windows rebuilds it as needed.
- Recycle Bin — empties deleted files. Make sure nothing in there is still wanted first.
- Windows Update Cleanup — removes superseded copies of update files that Windows keeps after installing newer ones. This can free a surprising amount of space and is safe, though the deletion may take a while and can continue during the next restart.
- Delivery Optimisation files and error-reporting files — caches and diagnostic data that are safe to clear.
Look before you clear
- Downloads folder — some versions of Disk Cleanup list your Downloads folder as a category. This deletes the actual files you have saved there, not temporary data. Review the folder first; it is easy to lose installers or documents you meant to keep.
- Previous Windows installation(s) and Windows upgrade log files —
these remove the
Windows.oldfolder created when you upgrade Windows. That folder is your built-in route to roll back to the previous version, and Windows only keeps it for a limited time anyway. Clearing it is fine once you are happy with the new version, but do not remove it if there is any chance you will want to go back.
The present-day equivalent: Storage Sense
On Windows 10 and Windows 11, Microsoft has folded most of Disk Cleanup's job into Settings. Open Settings → System → Storage and you will find a live breakdown of what is using space, plus one-click clean-up suggestions that cover the same ground as the classic tool — temporary files, the Recycle Bin, and so on.
Storage Sense is the automatic side of this. Turn it on and Windows will clean temporary
files on its own, empty the Recycle Bin after a period you choose, and manage downloaded files by age. It is
the modern answer to scheduling cleanmgr /sagerun, done through a friendly interface rather than
Task Scheduler.
Microsoft has signalled that the legacy Disk Cleanup interface is being retired over time in favour of
the Settings experience. For now, both exist: cleanmgr.exe and its /sageset and
/sagerun flags still work and remain the easiest option for scripted or scheduled clean-ups,
while Storage Sense is the better fit if you would rather set it once and forget it.
Quick reference
- Open Disk Cleanup: search Disk Cleanup, or run
cleanmgr. - Include system files: click Clean up system files in the tool.
- 64-bit shortcut target:
%SystemRoot%\System32\cleanmgr.exe. - Save a preset:
cleanmgr /sageset:1. - Run a preset:
cleanmgr /sagerun:1. - Automatic clean-up: Settings → System → Storage → Storage Sense.
Frequently asked
Why does Disk Cleanup behave differently from the Start menu shortcut on 64-bit Windows?
On a 64-bit version of Windows there are two copies of many system tools: a native 64-bit one in the System32 folder and a 32-bit one in the SysWOW64 folder. On older 64-bit Windows the Start menu shortcut for Disk Cleanup could point at the 32-bit copy, which meant one job — cleaning up older System Restore points and Shadow Copies (Previous Versions) — did not work correctly from that shortcut. Launching Disk Cleanup another way, such as the Disk Cleanup button on a drive's Properties window, ran the correct executable. Pointing the shortcut at %SystemRoot%\system32\cleanmgr.exe restores full behaviour.
Is it safe to delete everything Disk Cleanup lists?
Most categories are safe: temporary files, thumbnail cache, the Recycle Bin, delivery optimisation files and Windows Update cleanup only remove data Windows can regenerate or no longer needs. Two categories deserve a second look. The Downloads folder category deletes the actual files you have saved there, not temporary data, so review it first. 'Previous Windows installation(s)' and Windows upgrade log files remove the Windows.old folder, which is your only built-in way to roll back to the previous version of Windows — once it is gone you cannot go back that way.
Does Disk Cleanup still exist in Windows 10 and Windows 11, or has Storage Sense replaced it?
The classic Disk Cleanup tool, cleanmgr.exe, still ships with current versions of Windows 10 and 11, and the /sageset and /sagerun command-line flags still work. Microsoft has, however, been steadily moving disk clean-up into Settings under Storage and Storage Sense, and has signalled that the legacy Disk Cleanup interface is being retired over time in favour of that. For now you can use either; for automatic, ongoing clean-up Storage Sense is the modern choice, while cleanmgr with /sagerun remains handy for scripted or scheduled clean-ups.