To clean up the hard drive on this computer, type disk cleanup in the taskbar search box, open it, pick the drive, tick the file types to delete and select OK. Then run it again with Clean up system files to reach the larger items such as leftover Windows update files.
The steps below follow Microsoft's documentation. Menu names can differ a little between Windows 10 and Windows 11, and on some systems Disk Cleanup is not the main tool any more, so the Storage settings page is covered further down.
How to run Disk Cleanup
- Type
disk cleanupin the taskbar search box and select Disk Cleanup from the results. You can also press Win+R and runcleanmgr. - Select the drive you want to clean (usually
C:), then select OK. The tool takes a moment to work out how much it can free. - Tick the box for each file type you want to delete. Selecting a name shows its description underneath. Downloaded Program Files, Temporary Internet Files and Thumbnails are ticked by default, so clear those boxes if you want to keep them.
- Select OK, then Delete files in the confirmation window.
The window shows "Total amount of disk space you gain" at the top. That figure is an estimate and updates as you tick and untick boxes.
Free more space with "Clean up system files"
The first screen only covers files your own account created. For the bigger items, select Clean up system files, choose the drive and select OK. After the tool recalculates, you see extra system file types you can delete.
One of them needs care. If you upgraded Windows fewer than 10 days ago, the previous version appears here as a deletable item. Deleting it removes the Windows.old folder, which is what Windows uses to roll back to the earlier version. Microsoft states that this cannot be undone. If you have just upgraded and are not sure the new version works for you, leave it ticked off for now.
What the categories mean
Microsoft's cleanmgr reference describes the categories as follows. Which ones you see depends on your Windows version and on what is actually on the disk.
| Category | What it is | Cost of deleting |
|---|---|---|
| Temporary Setup Files | Files left by a setup program that is no longer running | None for a finished install |
| Downloaded Program Files | ActiveX controls and Java programs downloaded when viewing certain web pages | Low |
| Temporary Internet Files | Cached web pages kept for quick viewing; personalised settings are left intact | Pages load once from the network again |
| Old Chkdsk Files | File fragments Chkdsk saved to the root folder of the disk | Described as unnecessary |
| Recycle Bin | Files you deleted but did not remove permanently | You can no longer restore them |
| Temporary Files | Scratch data that programs store in a Temp folder | Safe if not modified in the last week |
| Catalog Files for the Content Indexer | Leftovers from an earlier search indexing run | None; described as safe to delete |
| Compress Old Files | Compresses files you have not used recently; nothing is deleted | Saves space, files still open normally |
Check the Recycle Bin line before you tick it. Deleted files only free space once the bin is emptied, and after that they cannot be restored from it.
Disk Cleanup on a drive other than C:
If you pick the drive that contains Windows, every option appears on the Disk Cleanup tab. For any other drive, such as a second internal disk, only the Recycle Bin and the content indexer catalog files are offered. Microsoft documents this in the cleanmgr reference. It means Disk Cleanup will not clear out a data drive full of video or downloads. For that, you need to find the big files yourself, which this guide to seeing what is taking up storage and the large-file search guide cover.
Use Storage Sense and Cleanup recommendations in Windows 11
Windows 11 puts most of this under Settings > System > Storage. Microsoft lists four groups under Cleanup recommendations: Temporary files, Large or unused files, Files synced to the cloud, and Unused apps. Remove previous Windows installations from the same place: open Temporary files, tick Previous Windows Installation(s) and select Remove files.
Storage Sense does the routine part automatically. Go to Start > Settings > System > Storage and set Storage Sense to On. You then choose how often it runs, when to delete Recycle Bin files that have been there a set time, and when to delete Downloads files that have not been opened for a set time. Two limits from Microsoft's page matter. It works only on the system drive (C:), and it ignores files marked Always keep on this device.
Be careful with the Downloads setting. A rule that deletes unopened files will also delete an installer or a document you downloaded months ago and meant to keep. Turn it on only if you are happy to lose anything you have not touched since.
Run Disk Cleanup from the command line
You can start the tool with options. The syntax from Microsoft Learn is:
cleanmgr [/d <driveletter>] [/sageset:n] [/sagerun:n] [/TUNEUP:n] [/LOWDISK] [/VERYLOWDISK]
| Option | What it does |
|---|---|
/d X | Cleans drive X. It is not used together with /sagerun |
/sageset:n | Opens the settings dialog and saves your choices under number n (0 to 9999) in the registry |
/sagerun:n | Runs the saved choices for n against every drive on the computer |
/tuneup:n | Runs /sageset and /sagerun for the same n |
/lowdisk | Runs with default settings |
/verylowdisk | Runs with default settings and no prompts |
/autoclean | Deletes files left behind after a Windows upgrade |
To save a set of choices once and reuse them, run these two commands. The first opens the dialog so you can tick your categories, and the second runs them:
cleanmgr /sageset:1
cleanmgr /sagerun:1
Microsoft notes that the saved profile can be run on a schedule with the Scheduled Tasks tool, so you can set up a regular clean without reopening the dialog. The number 1 is arbitrary. Pick any number in the range and use the same one for both commands.
If the space does not come back
Disk Cleanup usually frees from a few hundred megabytes to a few gigabytes, and the gain depends entirely on what has piled up on your machine. If the drive is still nearly full afterwards, the space is in your own files. Microsoft's advice is to check Videos, Music, Pictures and Downloads, which often hold the largest files, to sort by size in File Explorer's Details view, and to empty the Recycle Bin afterwards. Other options on the same page are moving rarely used files to a USB drive or SD card, and turning on OneDrive Files On-Demand so that files stay as placeholders instead of full local copies.
Two other cases are worth checking. If cleanup keeps failing with a low disk space error, Microsoft suggests that Store app files may be filling the Temp folder, and recommends running the Windows Store Apps troubleshooter, running wsreset.exe, running the Windows Update troubleshooter and restarting. And if Windows itself behaves oddly after a cleanup, check the system files with SFC and DISM. Disk Cleanup removes only categories it lists, so it is rarely the cause, but it is a quick test.
Frequently asked questions
- Is it safe to run Disk Cleanup?
- Yes, if you read what each category is before ticking it. Microsoft says you can safely delete temporary files that have not been modified within the last week. The one choice you cannot undo is the previous Windows installation (Windows.old), because deleting it removes the ability to go back to the older version.
- Will Disk Cleanup delete my personal files?
- Not by itself. Its categories are temporary files, caches, the Recycle Bin, thumbnails and leftover system files. Your Documents, Pictures and Desktop are not listed. The Recycle Bin is the exception to watch, because anything you deleted earlier is gone for good once you empty it.
- What is the difference between Disk Cleanup and Storage Sense?
- Disk Cleanup (cleanmgr.exe) is a tool you run by hand and choose categories for. Storage Sense is a setting under Settings > System > Storage that can remove temporary files and Recycle Bin contents automatically, and it only works on the system drive. Microsoft's Disk Cleanup page points to Disk Cleanup for systems that do not have Storage Sense.
- Why does Disk Cleanup only offer the Recycle Bin on my other drive?
- Microsoft documents this behaviour: for the drive that holds Windows, all options appear on the Disk Cleanup tab. For any other drive, only the Recycle Bin and the catalog files for the content indexer are available.