How to Clean the Hard Drive in Windows 7 with Disk Cleanup

To clean the hard drive in Windows 7, open Start, type cleanmgr, press Enter, pick the system drive (usually C:), tick the file types to delete and click OK. Click "Clean up system files" first if you also want to remove old Windows Update and service pack files. Disk Cleanup is built into Windows 7.
This guide covers what Disk Cleanup removes, which boxes are safe to tick, the System Restore trade-off, how to automate it with cleanmgr switches, and what to do when an option is missing. Windows 7 has been out of support since January 2020, so cleaning up is also one of the few maintenance steps worth keeping on an old machine.
How do you open Disk Cleanup in Windows 7?
You open Disk Cleanup in Windows 7 by typing cleanmgr or "disk cleanup" into the Start menu search box and pressing Enter. The tool is also listed under Start, All Programs, Accessories, System Tools. No download or third-party software is needed.

A small dialog asks which drive to clean. Disk Cleanup handles one drive at a time, and the drive Windows is installed on is where it frees the most space.

After a short scan, the Disk Cleanup window lists the file groups it found and how much space each one uses. Every ticked entry is deleted when you click OK and confirm with Delete Files. Cancel leaves everything untouched.
What does Disk Cleanup delete, and what should you tick?
Disk Cleanup deletes temporary and disposable files, and the ones that are safe to tick on almost every Windows 7 PC are the Recycle Bin, temporary files, temporary Internet files, thumbnails and downloaded program files. The exact list depends on what is installed, so the table covers the entries you will most likely see.
| Entry | What it removes | Tick it? |
|---|---|---|
| Recycle Bin | Files you already deleted | Yes, after a quick look inside |
| Temporary files | Leftovers in the Temp folder that no program is using | Yes |
| Temporary Internet Files | Cached web pages of Internet Explorer | Yes |
| Thumbnails | Cached picture previews, rebuilt on demand | Yes |
| Offline webpages | Pages saved for offline reading | Only if you do not read them |
| System error memory dump files | Crash dumps from blue screens | Yes, unless you are debugging a crash |
| Windows Error Reporting files | Stored crash and problem reports | Yes |
Thumbnails and caches come back as you use the PC, so the space they free is temporary. The biggest one-time gains come from the system files described next.
How do you free more space with "Clean up system files"?
Clicking "Clean up system files" in the Disk Cleanup window restarts the scan with administrator rights and adds the entries that hold the most space, such as Windows Update Cleanup, service pack backup files and Windows upgrade log files. Select the system drive again when asked.
The Windows Update Cleanup entry deletes superseded Windows updates from the WinSxS component store. Microsoft added it to Windows 7 SP1 through an update to Disk Cleanup, so it appears only when that update is installed and when superseded updates exist. The cleanup runs in the background and may ask for a restart. Afterwards you may not be able to uninstall the deleted updates, although you can reinstall them manually. For a view of what takes space in that folder, see our guide to analyzing the WinSxS folder.
The same window gains a More Options tab. It can open the list of installed programs and, under System Restore and Shadow Copies, deletes all restore points except the most recent one. That can free several gigabytes, but you lose the older points to roll back to. Wait a week or more after a service pack or major update before using it, and make a backup first if the PC matters.

How do you automate Disk Cleanup with cleanmgr?
You automate Disk Cleanup by running cleanmgr /sageset:n once to save your choices, then cleanmgr /sagerun:n to repeat them, where n is any number from 0 to 65535. Microsoft documents both switches for Windows 7 SP1.
- Open a Command Prompt and run cleanmgr /sageset:11 /d C.
- Tick the entries you want in the dialog and click OK. Windows stores them as profile 11 in the registry.
- Run cleanmgr /sagerun:11 any time, or schedule that command in Task Scheduler for a weekly run.
The /sagerun switch goes through all drives on the computer using the saved profile, and it does not take the /d drive switch. The profile number is only a label, so use a different number for each preset you want to keep.
Why is an option missing, or Disk Cleanup slow or stuck?
A missing Windows Update Cleanup option usually means the Disk Cleanup update is not installed or there are no superseded updates left to delete. Install the update through Windows Update, restart, then run Disk Cleanup and click "Clean up system files" again.
Other common problems and fixes:
- Few options and no system files: you picked a data drive. Run it again on the Windows drive.
- Long scan: a Recycle Bin or Temp folder with a huge number of files slows the scan. Let it finish before you close the window.
- cleanmgr not found on Windows Server 2008 R2: the tool is not installed there by default. It requires the Desktop Experience feature.
- Space did not grow: restart the PC, since Windows Update Cleanup may need a restart to finish.
Is Disk Cleanup enough, or should you use CCleaner?
Disk Cleanup is enough for a safe, once a week clean, while CCleaner covers more, including browser caches of other browsers and application leftovers that Disk Cleanup ignores. Disk Cleanup's Windows Update Cleanup entry is the Microsoft-supported way to remove superseded updates, so run it even if you also use CCleaner for browser and app leftovers.
Whichever you use, deleting is permanent: neither tool offers an undo, and the Recycle Bin is emptied for good. If you are cleaning because the disk is full, check what is large before you delete. Our look at the CCleaner 5 interface shows what the cleaner covers, and the Compact.exe guide shows how to shrink files in place on newer Windows versions.
Is it still worth cleaning Windows 7?
Cleaning is still useful on Windows 7, but the system itself is out of support: Microsoft ended support for Windows 7 SP1 in January 2020, and the paid Extended Security Updates for business customers ended in January 2023. Disk Cleanup keeps working the same way, yet nothing it removes fixes security problems. If the PC goes online, see what happens with unsupported browsers on Windows 7.
Primary references: Microsoft: Windows Update Cleanup in Disk Cleanup and Microsoft: automating Disk Cleanup.
Related: Analyze the WinSxS folder, Free disk space with Compact.exe
Why my C: hard disk capacity increased after I cleaned by Disk Cleanup??? Please help!!!!
My laptop is French. The start menu does not recognise cleanup. I can’t get into the system. Any ideas?
For more options to Disk Cleanup Wizard
run cleanmgr /sageset:11
select files to delete and click ok.
Then run cleanmgr /sagerun:11
A click on Clean up system files not only gives you the extra More Options tab. It also requires you to provide the admin password. This means you’re not longer cleaning a regular user’s temporary files, etc but the administrator’s ones.
Roebie, it is probably because it allows the user to clean system restore points.