How to Run Disk Cleanup and Defragmentation on Windows
Short answer: Disk Cleanup removes temporary files, update leftovers, and other clutter Windows no longer needs. Defragment and Optimize Drives reorganizes a hard drive's data so the read head finds files faster. SSDs skip defrag entirely; Windows uses the TRIM command for them instead, so you only need Disk Cleanup on an all-SSD gaming PC.
What Disk Cleanup Does
Disk Cleanup is a built-in Windows utility that scans for files your system no longer needs and lets you remove them in a few clicks. The categories it finds include temporary Windows and application files, installer leftovers, thumbnail caches, Recycle Bin contents, delivery optimization files, and logs left by updates.
For a gaming PC, that clutter accumulates quickly. Launchers, driver installers, and large updates write temporary files that stay behind after they finish, and the drive space they occupy is space you cannot use for a growing game library. Running Disk Cleanup restores that space without touching installed games or saves.
When the scan finishes, the tool shows a list of categories with the space each one occupies. Windows only offers files that are safe to delete; your games, documents, and settings are not in those folders. You can leave a category unchecked if you want to keep its contents, and the description under the list explains what each one holds.
- Temporary files
- Windows Update Cleanup
- Recycle Bin
- Thumbnails
- Delivery Optimization Files
- Previous Windows installations (shown after opening Clean up system files)
How to Run Disk Cleanup
Open the Start menu and type Disk Cleanup. The search result opens the tool and asks which drive to scan; choose the drive that holds Windows and your games, usually the C: drive. Windows scans that drive and then shows the categories.
Check the boxes for whatever you want to remove, review the description beneath the list, then click OK and confirm with Delete Files. The cleanup runs quickly and closes when it is done. You can run it again at any time; there is no minimum amount of time you must wait between runs.
For deeper cleaning, click the Clean up system files button. The tool rescans with system-level categories, including Windows Update Cleanup and previous Windows installations. Use this when you want to clear large remnants of past updates. It is especially useful after a feature update to Windows, and it pairs well with the broader settings covered in the guide to optimizing Windows for gaming.
How to Defragment a Hard Drive
Open the Start menu and type Defragment and Optimize Drives. The tool lists every physical drive in your system. For a traditional hard drive, select the drive and click Analyze to see how fragmented it is; the Status column then shows a percentage.
Click Optimize to start the reorganization. Windows moves file blocks so the read head can find them in order instead of jumping across the platter, which is the maintenance that keeps a spinning drive responsive. The process can take a while on a large drive, so it runs best when you are not about to jump into a session.
Windows normally handles this automatically on a schedule. The Enable or Schedule button lets you check the frequency, and you can turn the schedule off for individual drives. An SSD shows as disabled in that schedule; the table below summarizes the difference. Before you make changes, the guide to checking drive health is a useful companion.
| Drive type | What Windows does | What you do |
|---|---|---|
| Hard drive | Runs Optimize on a schedule to reduce fragmentation | Check the schedule and let it run when you are not playing |
| SSD | Disables defrag and sends TRIM commands | Run Disk Cleanup; leave Optimize alone |
Why SSDs Do Not Need Defragmentation
An SSD stores data in flash cells and has no moving components. Any location is reached at the same speed, so fragmented files do not slow reads the way they do on a hard drive. Reorganizing them would only write extra data without a benefit, and every write counts against the drive's endurance.
Windows therefore marks SSDs as Never run in the Optimize tool and uses the TRIM command instead. TRIM tells the drive which blocks are free, keeping the SSD clean at the controller level. Opening Defragment and Optimize Drives on an SSD should show a status such as OK or Never run, and that is exactly what you want.
The distinction matters when you buy a machine: see hard drives versus SSDs for gaming for how the two storage types fit different jobs. A single fast SSD avoids the issue entirely, while a two-drive setup gives you a place to keep an HDD for older files.
A Simple Maintenance Routine for Your Game Library
A practical habit is to run Disk Cleanup once a month or after a few large updates. Use the Clean up system files option periodically to clear old Windows update remnants, and open Defragment and Optimize Drives occasionally to confirm the schedule is active for any hard drive.
Beyond the tools, organize the library: keep the games you play most on the fastest storage, move rarely launched titles to a secondary drive, and let Disk Cleanup remove the installer and update files that games leave behind. Adding more storage to a gaming PC explains how a second drive fits this layout.
If you are comparing machines, an SSD for the system and current games with a hard drive for archives is a common combination. The best SSDs for gaming and best prebuilt gaming PC guides compare configurations by stated specs, so you can see which approach suits the way you play.
What Storage Sense Adds
Storage Sense is the automatic alternative inside Windows. It can remove temporary files and empty the Recycle Bin on a schedule without opening Disk Cleanup. Many players enable it for day to day management and keep Disk Cleanup for occasional deep cleans.
The two tools overlap but do not conflict. Storage Sense runs quietly in the background, while Disk Cleanup gives you manual control over each category. Either approach keeps a gaming PC from filling up with files no one needs, and both are built into Windows so you do not need third-party utilities.
What to pick for your play
| If you | Pick | Buying guide |
|---|---|---|
| You store games on an SSD and keep a hard drive for older files | Defrag the hard drive on schedule; run Disk Cleanup monthly on the SSD | Best SSDs for Gaming in 2026: Picks by Stated Specs |
| The whole machine is one SSD | Skip defrag entirely; use Disk Cleanup and Storage Sense to keep space | Best Gaming PC 2026: The Best Prebuilt Gaming PCs at Every Budget |
| You stream or record gameplay to a hard drive | Defrag that drive weekly and keep free space for recordings | Best Gaming PC 2026: The Best Prebuilt Gaming PCs at Every Budget |
| You keep a growing library across two drives | Use Disk Cleanup to clear launcher temp files; leave defrag to Windows | Best SSDs for Gaming in 2026: Picks by Stated Specs |
| You are choosing a new gaming PC and want low-maintenance storage | A single large SSD avoids defrag entirely | Best SSDs for Gaming in 2026: Picks by Stated Specs |
Questions
Does defragmenting an SSD damage it?
It is unnecessary rather than harmful. An SSD reads any block at the same speed, so the process gains nothing and causes extra writes. Windows disables it automatically.
Why does Optimize Drives say 'Never run' for my SSD?
Because Windows detects the SSD and knows defragmentation is pointless. The same tool sends TRIM commands to keep the drive clean.
How often should I run Disk Cleanup?
Once a month or after large updates is a reasonable habit. There is no fixed rule; the tool only removes files you approve.
Can I play while Disk Cleanup or defrag runs?
Disk Cleanup is short and has little effect on play. Defragmentation on a hard drive keeps the disk busy, so it is better to run it before or after a session.
What does the Analyze button do?
It checks the drive and reports how fragmented it is without changing anything. Use it to see whether a hard drive needs optimization.
Is Storage Sense the same as Disk Cleanup?
Storage Sense automates similar cleanup on a schedule; Disk Cleanup is a manual tool. You can use both, though they target overlapping categories.
Recent updates
- : First published.
