Home / Disk Cleanup

How Disk Cleanup Decides Which Files It Can Remove

Disk Cleanup removes categories of files that Windows already classifies as disposable. Open it, read the list, clear any box you do not understand, and only then select OK. It does not delete your Documents folder, and it is not a substitute for finding one huge video or game.

What Disk Cleanup does

Disk Cleanup, the program behind cleanmgr.exe, calculates how much space each temporary category would return and deletes only the boxes you leave checked. Microsoft’s own free-space guide still documents it for Windows, including the button labeled Clean up system files. On Windows 11 the newer screen is Settings, System, Storage, and cleanmgr is still present on a normal installation.

The tool is free because it ships with Windows. It is not a third-party optimizer, and it does not defragment the drive. If you are trying to understand a single oversized folder, use Find large files or a disk space analyzer after this pass, not instead of reading the category list.

Diagram splitting Disk Cleanup into a first list of temporary files and a second list that appears after Clean up system files.
The first list is ordinary cleanup. Clean up system files adds Windows Update leftovers and, when it exists, the previous Windows installation.

How to open it

Use whichever path matches the PC in front of you. All three open the same program.

  1. Select Start, type Disk Cleanup, and open the Disk Cleanup app. Choose the drive, usually C:, and select OK. Wait while it calculates. The wait is the scan, not a freeze.
  2. Or press Windows logo key + R, type cleanmgr, and press Enter. Pick the drive when asked.
  3. On Windows 11 you can also start at Settings, System, Storage, Temporary files. That page is the newer list and overlaps Disk Cleanup. The Windows 11 Storage guide walks through that screen. Disk Cleanup remains the right tool when you specifically want cleanmgr, including on Windows 10.

Windows 7 and Windows 8 still have Disk Cleanup if the PC is running them. The category names are older, and those systems are out of support, so treat the cleanup as maintenance on an aging install rather than a security fix.

Which categories are reasonable

Select a category name to read Microsoft’s description in the box under the list. These are the ones people usually clear, and the limits that go with them.

CategoryWhat it isPractical limit
Temporary filesApp scratch files that are not in use.Close browsers and installers first. A file in use is skipped or comes back.
ThumbnailsThe small previews Explorer caches for pictures and videos.Safe to remove. Explorer rebuilds them, so the next time you open a photo folder it can feel slower.
Recycle BinFiles you already deleted, still recoverable.Empty it only after you are sure you do not need to restore anything.
Delivery Optimization FilesUpdate pieces Windows may keep to share with other PCs on the network.Safe to remove. Windows can download the pieces again later.
Temporary Internet FilesAn older cache name, still listed on some PCs.Removing it can sign you out of a site. It does not remove passwords stored in the browser account.

Downloaded Program Files is a legacy ActiveX cache. On a current PC the gain is often zero. Leave it unchecked if the description does not match anything you use.

More detail on paths such as your user Temp folder is in Temporary files. Disk Cleanup is the safer way to clear those categories, because it skips files Windows still has open.

The system-files pass

The first window hides the largest Windows categories. Select Clean up system files, choose the drive again, and wait for a second calculation. That pass can add:

Read Previous Windows installation before you check it. You want the space only if you have already decided you will not roll the PC back to the earlier version of Windows.

The cleanmgr command

Administrators sometimes want the same tool without the menus. The ordinary command is cleanmgr. To aim it at C: you can run cleanmgr /d C. There is also an older pair, cleanmgr /sageset:n and cleanmgr /sagerun:n, which stores a set of checkboxes and reruns that set. Use those only on a PC you administer, and look at the checkbox list the first time instead of copying a script from a forum. A script someone named “labtech disk cleanup” is not part of Windows.

When it sits on one line

Calculating “Windows Update Cleanup” or “Language resource files” can take many minutes on a drive that has years of updates. That line is a progress label, not proof that the tool has failed. Give it time, and leave the PC awake.

If the window has not moved for a long time and Task Manager shows cleanmgr using no CPU and no disk, close it and use Settings, System, Storage, Temporary files instead. A missing Disk Cleanup entry on Windows 11 usually means the app search missed cleanmgr. The Run dialog still opens it. Storage settings are the supported fallback, described with Storage Sense if you would rather let Windows repeat the temporary-file pass later.

What it should not be asked to delete

Disk Cleanup never offers C:\Windows\System32, your user profile, or installed programs as categories. Do not “help” it by deleting those folders yourself. Defragmentation is a different job: run cleanup first if you are trying to free space, and do not defragment an SSD. Solid-state drives do not benefit from the old defrag pass, and Windows already runs its own optimization schedule.

A Mac has no Disk Cleanup and no cleanmgr. Apple’s path is the Apple menu, System Settings, General, Storage. This page will not map Windows categories onto macOS.

Diagram listing Windows folders that should not be deleted by hand: System32, WinSxS, Installer, and System Volume Information.
If a folder is not in Disk Cleanup’s list, do not remove it to finish the job faster.

How to verify the result

Open File Explorer, select This PC, and read the free-space line under the drive you cleaned. Then empty nothing else until you compare that number with the one you wrote down first. If the gain is a few megabytes, the checked categories were small. The space you still need is in a large personal file or a system store, which is the situation covered in C drive full.

Diagram of a C drive free-space readout, marked as an example, with a partly filled capacity bar.
Compare free space on the same drive before and after. The numbers in the diagram are an illustration.

If the free space hardly changes

Disk Cleanup can only return what its categories contain. A 40 GB video in Downloads, a game, or hibernation file will still be there. Continue with how to free up disk space and look at Storage categories. If Windows Update itself is failing because the drive is full, Microsoft’s free-space article also points at an external drive as scratch room for a feature update. That is a different procedure from deleting temporary files.

How to keep the same categories from piling up

Turn on temporary-file cleanup in Storage Sense if you want Windows to repeat the safe part on a schedule. Leave the Downloads option alone. Uninstall programs you do not use from Settings, Apps, rather than from Disk Cleanup, because Disk Cleanup does not uninstall apps.

Questions from the search

Is Disk Cleanup safe?

It is safe when you read the categories. The risky boxes are the ones that remove a previous Windows installation or empty the Recycle Bin, and only because those choices are hard to undo.

Will Disk Cleanup delete important files?

It deletes the categories you leave checked. It does not remove Documents, Pictures, or installed desktop programs. Previous Windows installation is important if you still want to roll back.

How long does Disk Cleanup take?

The calculation is often a minute or two. Windows Update Cleanup on an old install can take much longer. There is no single duration.

Should I run Disk Cleanup or defrag first?

Cleanup first, if the goal is free space. Skip a manual defrag on an SSD.

What are temporary files in Disk Cleanup?

Files programs left in temp locations and are not using now. They are not the same as the files sitting in your Downloads folder.

Sources checked for this page