C Drive Full but Folders Don't Add Up? Find the Hidden 75GB (WinSxS)

スポンサーリンク
C Drive Full but Folders Don't Add Up? Find the Hidden 75GB (WinSxS) Windows
スポンサーリンク

The free space on my PC’s C drive (512GB NVMe SSD) had quietly dropped to 96GB. To find out why, I added up folder sizes in Explorer, PowerShell, but the total came out about 75GB less than the actual usage. 75GB that I couldn’t find anywhere.

Short answer: the invisible space was in places you can’t count with normal permissions (other users’ folders, Store apps, WinSxS, restore points, etc.). After examining them with admin rights, I cleaned up Windows junk (crash dumps, the Delivery Optimization cache, old WinSxS updates), taking free space on C from 170.2GB to 184.2GB (about 14GB more). Below: how I investigated, what I deleted, what I kept, with measured numbers.

I had Claude Code (an AI coding tool) do the investigating; I decided on each deletion myself, one at a time.

Results first: what I did, how much it freed

Action Removed Free space on C afterwards
(before) 96GB
Uninstalled a game I no longer play A game installed twice, on C plus D (about 74GB) 170.1GB
Deleted a crash dump One dump over a year old in LiveKernelReports (1.75GB) 171.9GB
Deleted the Delivery Optimization cache Download cache for Windows Update etc. (2.3GB) 174.2GB
WinSxS cleanup + removing unused Store apps Old update backups, Power BI Desktop, Power Automate 184.2GB

The unused game helped most, but that varies by person. Windows cleanup alone freed about 14GB. I uninstalled two Store apps while the WinSxS cleanup ran, so the last row’s ~10GB includes both.

Step 1: measure folder sizes with admin rights

With normal permissions (PowerShell or Explorer not run as administrator), you can’t count the contents of folders you have no access to. So the folder sizes don’t add up to the usage, leaving “space you can’t find anywhere”. To count properly, investigate with admin rights.

I got the total size of each subfolder directly under a folder with this script. It only reads; it changes nothing. Save it as dirsize.ps1:

param([string[]]$Roots)
# Total size of each subfolder directly under the given folders (read-only)
function Get-DirSize([string]$path) {
    $total = [long]0
    $stack = New-Object System.Collections.Generic.Stack[string]
    $stack.Push($path)
    while ($stack.Count -gt 0) {
        $d = $stack.Pop()
        try {
            $di = New-Object System.IO.DirectoryInfo $d
            foreach ($f in $di.EnumerateFiles()) { $total += $f.Length }
            foreach ($s in $di.EnumerateDirectories()) {
                if (-not ($s.Attributes -band [System.IO.FileAttributes]::ReparsePoint)) { $stack.Push($s.FullName) }
            }
        } catch {}
    }
    return $total
}
foreach ($root in $Roots) {
    "=== $root ==="
    $rows = @()
    try {
        $rdi = New-Object System.IO.DirectoryInfo $root
        $loose = [long]0
        foreach ($f in $rdi.EnumerateFiles()) { $loose += $f.Length }
        $rows += [pscustomobject]@{ Path = "(files in the folder itself)"; GB = [math]::Round($loose/1GB,2) }
        foreach ($s in $rdi.EnumerateDirectories()) {
            if ($s.Attributes -band [System.IO.FileAttributes]::ReparsePoint) { continue }
            $rows += [pscustomobject]@{ Path = $s.Name; GB = [math]::Round((Get-DirSize $s.FullName)/1GB,2) }
        }
    } catch { "error: $_" }
    $rows | Sort-Object GB -Descending | Format-Table -AutoSize | Out-String -Width 200
}

Right-click the Start button, open “Terminal (Admin)”, move to the folder where you saved it, then run the line below. It skips junctions (folders that point elsewhere) to avoid counting things twice.

powershell -NoProfile -ExecutionPolicy Bypass -File .\dirsize.ps1 -Roots 'C:\','C:\Windows','C:\Users','C:\Program Files','C:\Program Files\WindowsApps','C:\ProgramData'

My PC’s results for directly under C:\ (at 305.5GB used):

Folder Size
Users 131.71GB
Windows 49.15GB
(files in the folder itself) 44.7GB
Program Files 28.61GB
Program Files (x86) 15.95GB
ProgramData 15.69GB
$Recycle.Bin (Recycle Bin) 4.55GB
Recovery 1.77GB

The 44.7GB of files directly under C: are the page file pagefile.sys (32GB), the hibernation file hiberfil.sys (13GB). Only System Volume Information gave “Access is denied” even as administrator, but it holds restore points, which step 2 checks separately.

Step 2: check the real size of restore points, WinSxS

Restore points (shadow copies)

Run this with admin rights to see how much space restore points use:

vssadmin list shadowstorage

My C drive showed 8.28 GB used, 9.52 GB maximum. Once the maximum is exceeded, the oldest are deleted automatically, so it doesn’t grow without limit.

WinSxS (component store)

C:\Windows\WinSxS looks huge in Explorer. But most files in it are hard links shared with other places in Windows, so it doesn’t use as much space as it appears. Run this with admin rights to see what’s really in it:

Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore

My PC’s result:

Windows Explorer Reported Size of Component Store : 21.20 GB
Actual Size of Component Store : 19.66 GB
    Shared with Windows : 8.89 GB
    Backups and Disabled Features : 10.76 GB
    Cache and Temporary Data :  0 bytes
Date of Last Cleanup : 2026-10-22 01:55:39
Number of Reclaimable Packages : 21
Component Store Cleanup Recommended : Yes

Look at “Backups and Disabled Features” (old update backups etc.), plus the last line, “Component Store Cleanup Recommended”. Yes means Windows itself judges that cleanup can reduce it. Mine had 10.76GB of backups, with cleanup recommended.

What the invisible space turned out to be

Putting steps 1, 2 together, the ~75GB I couldn’t see with normal permissions was roughly this:

What Size What I did
Another user’s folder on the same PC (C:\Users\<other user>) 21.5GB Their data, so I left it alone
Store apps (C:\Program Files\WindowsApps) 18.2GB Removed two I don’t use
Old update backups in WinSxS 10.8GB Cleaned up
Restore points 8.3GB Kept
C:\Windows\ServiceProfiles 6.3GB Mostly the Delivery Optimization cache; deleted the cache
C:\ProgramData\Microsoft 7.3GB Left alone
Recycle Bin 4.6GB Not emptied this time
Crash dumps (C:\Windows\LiveKernelReports) 1.7GB Deleted
Administrator account’s folder 1.5GB Left alone

On a PC shared with family, other users’ folders can be bigger than you’d think. Don’t delete those yourself; ask the owner to tidy up.

Step 3: delete crash dumps

C:\Windows\LiveKernelReports keeps dump files Windows writes when it hangs, for example. Mine had just one, ResourceTimeout-20250601-0003.dmp from June 2025 (1752.6MB). Over a year old, with no plan to investigate it, so I deleted it. Check the contents first, then run this in an admin PowerShell:

Get-ChildItem C:\Windows\LiveKernelReports -Recurse -File -Force | Select-Object FullName, Length, LastWriteTime
Get-ChildItem C:\Windows\LiveKernelReports -Force | Remove-Item -Recurse -Force

Free space on C went from 170.18GB to 171.89GB. If you’re still investigating a recent blue screen or freeze, keep the dumps; they’re evidence for finding the cause.

Step 4: delete the Delivery Optimization cache

“Delivery Optimization” is used for Windows Update, Microsoft Store downloads, keeping downloaded files as a cache. Microsoft’s docs say the cache is cleared automatically, but you can clear it by hand if you need disk space. See how much is cached now:

Get-DeliveryOptimizationStatus | Measure-Object FileSizeInCache -Sum

Mine was 2.30GB. Delete it with this one line in an admin PowerShell:

Delete-DeliveryOptimizationCache -Force

It printed “Successfully deleted Delivery Optimization cache”, with free space on C going from 171.89GB to 174.24GB. Without commands, as Microsoft’s docs say, you can do the same in Disk Cleanup by checking “Delivery Optimization Files”.

Step 5: clean up WinSxS

Never delete files inside the WinSxS folder by hand. Microsoft’s docs warn that deleting files from WinSxS can leave your PC unable to boot or update. To shrink it, use the DISM command Windows provides. Run this in an admin Command Prompt or PowerShell:

Dism.exe /Online /Cleanup-Image /StartComponentCleanup

On my PC it finished in about 6 minutes with “The operation completed successfully.” Windows normally does the same thing automatically through the StartComponentCleanup task in Task Scheduler. But the automatic run doesn’t remove old versions until 30 days after an update, stopping after one hour. Running DISM by hand removes them right away, with no time limit.

I didn’t add /ResetBase

You’ll often see /ResetBase recommended online. It shrinks things further, but per Microsoft’s docs, afterwards you can no longer uninstall the updates currently installed. If an update causes problems, you can’t roll it back, so I didn’t use it.

Step 6: remove unused Store apps

The largest items in C:\Program Files\WindowsApps included Power BI Desktop (2.7GB), Power Automate (1.17GB). I used neither, so I removed them. Normally you can do it from Settings → Apps → Installed apps, via “…” next to the app → “Uninstall”.

I used PowerShell. Power Automate was running in the background, so I stopped its process first (run in a normal, non-admin PowerShell):

Get-AppxPackage | Where-Object Name -match 'PowerBI|PowerAutomate' | Format-List Name, Version, PackageFullName
Get-Process | Where-Object { $_.Path -match 'PowerAutomate|PowerBI' } | Stop-Process -Force
Get-AppxPackage -Name Microsoft.MicrosoftPowerBIDesktop | Remove-AppxPackage
Get-AppxPackage -Name Microsoft.PowerAutomateDesktop | Remove-AppxPackage

Both disappeared from the app list. Power BI’s folder went too, but Power Automate’s folder (about 1.2GB) was still in WindowsApps at that point. If another user on the PC also has it installed, the folder stays until it’s uninstalled for them too. I didn’t check which was the reason in my case.

What I kept, what I didn’t try

  • Restore points (8.3GB): insurance if something goes wrong, while anything over the cap (9.52GB for me) is deleted oldest first, so I kept them
  • The page file pagefile.sys (32GB): shrinking it risks crashing memory-hungry work like AI image generation, so I left it
  • The hibernation file hiberfil.sys (13GB): if you don’t use hibernation, powercfg /h off with admin rights removes it, but I haven’t tried it yet
  • Another user’s folder (21.5GB): their data, so I didn’t even look inside
  • WinSxS /ResetBase: not used, since it makes updates impossible to uninstall

Other big items in my own user folder were Chrome’s cache (12.6GB), plus .codex (29GB), the work folder of the AI coding tool Codex. Using Claude Code or Codex, conversation logs pile up in your user folder (how they filled my File History backup drive is in File History filled up with Claude Code, Codex conversation logs).

I later moved those conversation log folders from C to D with a junction. The steps, plus where I got stuck, are in Move Claude Code, Codex conversation logs off the C drive (in Japanese).

Summary

  • If folder sizes don’t add up to the usage, investigate with admin rights. Other users’ folders, WindowsApps, WinSxS, restore points etc. can’t be counted with normal permissions
  • Check restore points with vssadmin list shadowstorage, WinSxS’s real contents with Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
  • Safe to delete for me: an old crash dump (1.7GB), the Delivery Optimization cache (2.3GB), WinSxS cleanup plus unused Store apps (about 10GB together)
  • Never delete WinSxS by hand; use /StartComponentCleanup. /ResetBase makes updates impossible to roll back, so I don’t use it

References

コメント

Copied title and URL