Disk Cleanup Stuck on Calculating Space – Fix
Disk Cleanup hangs at calculating space. This is usually a corrupted temp folder or a stuck Windows Search index. Here's how to unstick it fast.
The Exact Scenario
You open Disk Cleanup (the built-in Windows tool, cleanmgr.exe). You select the C: drive. It starts scanning, but it gets stuck at "Calculating space to free…" for 10+ minutes. The progress bar doesn't move. Sometimes it says "Scanning: System files" or just hangs at 0%.
Common triggers: you just ran a Windows update, you have a ton of temp files from browser caches, or the Windows Search index is corrupted. I've seen this most often on machines with less than 4GB RAM and a nearly-full C: drive. Or after a Windows 10 feature update.
Root Cause
The culprit here is almost always a corrupted temp folder or a stuck Windows Search index. Disk Cleanup tries to enumerate all files in the %TEMP% folder and the Recycle Bin. If one of those has a file with a long path, a permission issue, or a broken shortcut, the cleanup tool freezes. Another common cause: the Windows Search indexer locks files while Disk Cleanup tries to scan them. The indexer can get stuck on a corrupt file and never release the lock.
Don't bother with sfc /scannow or DISM restorehealth—they rarely fix this. The real fix is clearing temp files manually and resetting the search index.
The Fix – Step by Step
- Kill Disk Cleanup. Open Task Manager (Ctrl+Shift+Esc). Find
cleanmgr.exe. Right-click it and choose End task. - Stop the Windows Search service. Open Command Prompt as admin (right-click Start -> Command Prompt (Admin) or Terminal (Admin)). Run:
This stops the search indexer. It'll free up any locked files.net stop wsearch - Clear temp folders manually. Open File Explorer, type
%TEMP%in the address bar, and hit Enter. Select all files (Ctrl+A) and press Delete. If some files won't delete, skip them—they're locked by running apps. Then do the same for%WINDIR%\TempandC:\Windows\Temp. You might need admin permission for the Windows temp folder. - Empty the Recycle Bin. Right-click the Recycle Bin on your desktop and choose Empty Recycle Bin. If it hangs too, use:
Run that in an admin command prompt. It deletes the hidden Recycle Bin folder.rd /s /q C:\$Recycle.bin - Restart the search service. In the same admin command prompt, run:
net start wsearch - Run Disk Cleanup again. Open it normally. This time it should start scanning quickly. If it still hangs, move to the next steps.
- Reset the search index. Go to Control Panel -> Indexing Options. Click Advanced -> Rebuild. This can take 30+ minutes on a big drive, but it fixes corruption.
- Last resort – disable Windows Search entirely. Open Services (services.msc). Find
Windows Search. Right-click, choose Properties, set Startup type to Disabled. Click Stop. Then rerun Disk Cleanup. After it finishes, you can re-enable the service if you need search.
What If It Still Fails?
If the above doesn't work, check these:
- Check for malware. A rogue process can lock temp files. Run a full scan with Windows Defender or Malwarebytes.
- Check disk health. Run
chkdsk C: /fin an admin command prompt. Reboot to let it run. Bad sectors can cause hangs. - Third-party cleanup tools. Use something like CCleaner (free version) or BleachBit. They don't scan the same way and often work when Disk Cleanup doesn't.
- Safe Mode. Boot into Safe Mode with Networking (hold Shift while clicking Restart). Then run Disk Cleanup. Fewer background processes means less chance of a conflict.
- Update Windows. Sometimes a bug in cleanmgr.exe gets patched. Check for updates in Settings -> Windows Update.
I've fixed this issue on dozens of machines with steps 2-4. Don't waste time on other fixes. The search indexer is the real villain here.
Was this solution helpful?