The system drive (C:) is almost full. In Settings > System > Storage the capacity bar is red, a Windows update says it needs more space or fails to install, or the PC has become slow. You want to get space back using only what comes with Windows, without breaking anything. Microsoft describes the red bar as the low disk state, and says low space can mean slower performance and trouble installing Windows updates.
Applies to: Windows 10 and Windows 11. Where the two differ, the text says so. Commands run in an elevated Command Prompt or PowerShell window (search for it, then Run as administrator). Work through the steps in order and check the free space after each one. Stop as soon as you have enough.
What is going on
Several things grow on a system drive without you doing anything, and Windows already trims most of them on its own:
- Temporary files and caches from Windows, Windows Update and apps.
- Update leftovers. The component store (the
WinSxSfolder) keeps older versions of components so you can roll back, and a feature update leaves the previous Windows version inWindows.old. - The hibernation file (
hiberfil.sys), which Microsoft says is approximately the size of the installed RAM, and the page file (pagefile.sys). - System Restore or shadow copy storage, which holds restore points.
- Your own files, including OneDrive files that are downloaded to the PC.
The safe part is the first two items and your own files. The rest are trade-offs: each one buys back space by giving up a feature. The steps below go from safest to most opinionated. Microsoft suggests keeping 10 to 15 percent of a drive free, which is a useful target.
Diagnosis
1. Before you start: check first
- Back up anything you cannot replace before you delete personal files, and on a managed PC check with whoever owns it, because Storage Sense and update cleanup may already be set by policy.
- Do not delete anything you cannot name. If a folder is not in the lists below, leave it.
- Check the free space now, so you can see what each step gains. In File Explorer, select This PC. The free space is shown under Devices and drives.
2. See what is big, with Windows tools only
Open Settings > System > Storage. The categories on the system drive (for example Apps, Temporary files and system files) show where the space is going. On Windows 11, Advanced storage settings > Storage used on other drives shows the same for other drives, which matters because Storage Sense only works on the system drive.
For more detail, PowerShell can add up file sizes. This lists the size of each top-level folder on C:, largest first. It only reads, it deletes nothing. It can take several minutes on a big drive, and folders you do not have rights to open are skipped without an error, so run it from an elevated window:
Get-ChildItem -LiteralPath C:\ -Directory -Force -ErrorAction SilentlyContinue |
ForEach-Object {
$bytes = (Get-ChildItem -LiteralPath $_.FullName -Recurse -File -Force -ErrorAction SilentlyContinue |
Measure-Object -Property Length -Sum).Sum
[pscustomobject]@{ Folder = $_.FullName; SizeGB = [math]::Round($bytes / 1GB, 2) }
} | Sort-Object SizeGB -Descending
To see the largest single files, here under C:\Users, and the big hidden system files in the root of C: (the page file and hibernation file show up here):
Get-ChildItem -LiteralPath C:\Users -Recurse -File -Force -ErrorAction SilentlyContinue |
Sort-Object Length -Descending | Select-Object -First 20 FullName,
@{ Name = 'SizeGB'; Expression = { [math]::Round($_.Length / 1GB, 2) } }
Get-ChildItem -LiteralPath C:\ -File -Force |
Select-Object Name, @{ Name = 'SizeGB'; Expression = { [math]::Round($_.Length / 1GB, 2) } }
Treat the totals as a guide, not an exact bill. Folders that were skipped, files that are listed under more than one name (hard links), and files that OneDrive shows but has not downloaded all affect the sums. [UNCONFIRMED: how Get-ChildItem reports Length for online-only OneDrive files and for hard-linked files under WinSxS. Microsoft documents that File Explorer overstates the size of WinSxS because of hard links. Use the DISM report in step 3 for that folder, not these sums.]
In File Explorer you can also open a folder, choose View then Details, right-click in the empty space and choose Sort by then Size. Microsoft points to the Videos, Music, Pictures and Downloads folders as the usual place for large personal files.
Root cause
Why this works: nothing here is broken. The drive is full because ordinary, removable data has built up and some features reserve space on purpose. Clearing temporary files and update leftovers costs you nothing you need. Hibernation, the page file and restore points are different, because removing them removes a feature. The warnings below say which is which.
The fix
Before you start: do not delete C:\Windows\WinSxS, or files inside it, by hand. Microsoft says deleting files from the WinSxS folder, or the whole folder, may severely damage the system so that it might not boot, and may make it impossible to update. Also do not delete hiberfil.sys or pagefile.sys directly. Use the commands and settings below instead. Do not use registry cleaners or third-party cleaner tools.
Step 1: Storage Sense, and the Temporary files list
Storage Sense removes items you do not need, such as temporary files and items in the Recycle Bin. Microsoft says it is off by default and that, when it is on with the default settings, it runs when the PC is low on disk space. It works on the system drive only, runs only while you are signed in and online, and its settings apply to your own account. To turn it on, go to Settings > System > Storage and set Storage Sense to On. Select Storage Sense to choose how often it runs, when to empty the Recycle Bin, and (optionally) when to clean the Downloads folder. It leaves Downloads and cloud files alone unless you tell it otherwise.
Then clean up by hand. On Windows 11, go to Settings > System > Storage > Cleanup recommendations and review Temporary files, Large or unused files, Files synced to the cloud and Unused apps. Windows shows the space each one saves. Select what you want gone and use Clean up. On Windows 10, open Temporary files under the disk usage on the Storage page, tick the items, and select Remove files.
Read each tick box. Previous Windows installation(s) is the Windows.old folder. Once it is deleted you cannot go back to the previous version of Windows, and Microsoft says this cannot be undone. Downloads may hold files you want. Untick both if you are unsure.
Step 2: Disk Cleanup, including system files
On Windows 10, Microsoft documents Disk Cleanup as the tool to use. Search the taskbar for disk cleanup, choose the drive, tick the file types (Downloaded Program Files, Temporary Internet Files and Thumbnails are ticked by default, so untick any you want to keep), and select Clean up system files. That reopens the list with the system file categories. Microsoft says the option to clean up updates helps reduce the size of the component store. Review the list, select OK, then Delete files.
On Windows 11, Microsoft’s drive space page points to Cleanup recommendations (step 1) rather than Disk Cleanup. The cleanmgr command is still documented for Windows, and you can start it from a Run box or prompt. [UNCONFIRMED: whether Disk Cleanup is present in every Windows 11 build. If cleanmgr does not start, use Cleanup recommendations in Settings instead.]
The cleanmgr command can repeat a chosen set of cleanups. /sageset:n opens the settings dialog and stores your choices under the number n (0 to 9999). /sagerun:n then runs exactly those choices on every drive:
cleanmgr /sageset:1
cleanmgr /sagerun:1
Two switches to leave alone. cleanmgr /autoclean deletes the files left behind after a Windows upgrade, which includes the files you would need to roll back. /verylowdisk runs with default settings and no prompts, so you do not get to review the list. Use the dialog instead.
Step 3: the component store (WinSxS)
The WinSxS folder looks huge in File Explorer, but much of that is hard links: files that appear in more than one place but are usually stored once. Do not judge it by its size in File Explorer. Ask DISM instead:
DISM.exe /Online /Cleanup-Image /AnalyzeComponentStore
The report separates the folder size as File Explorer sees it from the real size, and tells you what is overhead. Microsoft defines the fields like this:
| Field in the report | What it means |
|---|---|
| Windows Explorer Reported Size of Component Store | The folder size as File Explorer computes it. It ignores hard links, so it is too high. |
| Actual Size of Component Store | The real size, which takes hard links into account. |
| Shared with Windows | Files hard-linked into normal Windows locations. Part of the actual size, but Microsoft says it is not overhead. |
| Backups and Disabled Features | Components kept for rollback and for optional features. Overhead. |
| Cache and Temporary Data | Files the store uses to speed up servicing. Overhead. |
| Number of Reclaimable Packages | Superseded packages that cleanup can remove. |
| Component Store Cleanup Recommended | Yes or No. Cleanup is recommended when it may reduce the overhead. |
Microsoft gives the real overhead as Backups and Disabled Features plus Cache and Temporary Data. If the report says cleanup is recommended, run it:
DISM.exe /Online /Cleanup-Image /StartComponentCleanup
This removes superseded components and compresses the store. It is the same job as the scheduled task StartComponentCleanup (Task Scheduler Library\Microsoft\Windows\Servicing\StartComponentCleanup), except that the scheduled task waits at least 30 days after an updated component is installed before it removes the older version, and has a one hour timeout. The DISM command deletes the older versions straight away and has no timeout. The grace period exists because Microsoft keeps older component versions for a time so you can roll back, so expect to lose that safety net for the cleaned-up versions.
Do not add /ResetBase as a habit. /StartComponentCleanup /ResetBase removes all superseded versions of every component. Microsoft warns that all existing update packages can no longer be uninstalled afterwards. It will not block uninstalling future updates. Leave it off unless you have decided you will not need to uninstall any current update. Microsoft also strongly recommends not disabling component cleanup.
Step 4: hibernation and the page file (trade-offs)
These two files are large and easy to see, which makes them tempting, but each one supports a feature. Decide before you change them.
| File | What it is for | What you lose by removing it |
|---|---|---|
hiberfil.sys (hibernation) | Stores a copy of memory so that the PC can hibernate. Microsoft says it is approximately the size of the installed RAM. Fast Startup also uses it. | Hibernate, hybrid sleep and Fast Startup stop working. Microsoft warns that if you make hibernation unavailable while hybrid sleep is turned on, you may lose data when power is lost. |
pagefile.sys (page file) | Extends memory and backs system crash dumps. Microsoft says some products require one, and that Windows Server domain controllers, DFS Replication servers, certificate servers and ADAM/LDS servers need it. | Less room for committed memory, which Microsoft says can cause freezing, crashing and other malfunctions. A page file or a dedicated dump file may also be needed to back a system crash dump. |
Hibernation. If you never hibernate and can live without Fast Startup (Microsoft says it helps the PC start faster after shutdown), turn hibernation off. Windows removes hiberfil.sys itself when hibernation is off, so you never delete the file by hand:
powercfg /hibernate off
To get it back, run powercfg /hibernate on. On laptops, think twice before turning it off, because hibernate is the only sleep state that keeps your session with no power at all. If you want to keep Fast Startup but shrink the file, Microsoft documents a reduced hibernation file, which is 20 percent of RAM by default, against 40 percent for the full file. A reduced file supports Fast Startup but not hibernate or hybrid sleep. Run powercfg /a to see what your PC currently supports, then:
powercfg /hibernate /type reduced
If that returns “the parameter is incorrect”, Microsoft says to set the size to zero first with powercfg /hibernate /size 0 and then run the reduced command again.
Page file. Leave it alone on a normal PC. Microsoft’s page file article explains that its purpose has always been to support a crash dump and to raise the commit limit, and that a system-managed file grows only when the commit charge nears the limit, so it is not simply wasted space. Turning it off to save space buys a few gigabytes at the cost of stability. [UNCONFIRMED: Microsoft’s page file article is labelled for Windows 10 and Windows Server. We did not find a Windows 11 equivalent. Moving the page file to another drive is also not covered here, because we did not verify the steps.]
Step 5: restore points and shadow copies
Restore points live in shadow copy storage. See how much a volume uses first:
vssadmin list shadowstorage /for=C:
Microsoft documents vssadmin resize shadowstorage for setting the maximum space shadow copy storage may use. To cap C: at 5 percent of the volume, for example:
vssadmin resize shadowstorage /For=C: /On=C: /MaxSize=5%
Resizing can delete restore points. Microsoft warns that resizing the storage association may cause shadow copies to disappear. Do it only if you accept losing your existing restore points. The minimum value is 1 MB, and if you give no /MaxSize there is no limit at all, so do not leave it out. If you are not sure what created the shadow copies, find out before you shrink the storage.
You can also change the limit in the System Protection settings: press Windows key + R, run sysdm.cpl, open the System Protection tab, select the drive and choose Configure. [UNCONFIRMED: this path comes from a Microsoft Q&A answer, not from the Microsoft documentation, so check the tab names on your build.] On recent Windows 11 builds Microsoft also documents a point-in-time restore setting under Settings > System > Recovery, with a maximum usage slider; Microsoft’s page says the default limit is 2 percent of the disk.
Step 6: OneDrive Files On-Demand
If you use OneDrive, Files On-Demand keeps a small placeholder on the PC instead of the full file. Files that are not downloaded show a cloud icon, and downloaded ones show a green check mark. Microsoft’s drive space page recommends turning it on. To get space back from files that are already downloaded, right-click the file or folder in File Explorer and choose Free up space. That removes the local copy and leaves the file in OneDrive. Always keep on this device does the opposite and downloads the file.
Storage Sense can do this automatically: under Storage Sense in Settings, the cloud content setting makes files online-only if they have not been opened for the number of days you choose. Microsoft says it never permanently deletes the files, and that files marked Always keep on this device are left alone. You can also set the state from a prompt with attrib: attrib +u <path> makes it online-only, attrib +p <path> pins it so it stays on the device.
Use Free up space, not Delete. Online-only files need a network connection to open. Do not delete files in a OneDrive folder to make space, because a deletion is a change in the sync. [UNCONFIRMED: the exact effect of deleting a file in a synced OneDrive folder on the cloud copy was not checked against the OneDrive documentation we read. Treat a delete as permanent until you have checked the OneDrive recycle bin.]
Verification
- In File Explorer, This PC shows more free space under Devices and drives than when you started. Aim for 10 to 15 percent of the drive free.
- The capacity bar in Settings > System > Storage is no longer red.
DISM.exe /Online /Cleanup-Image /AnalyzeComponentStorenow says Component Store Cleanup Recommended is No, and shows a recent Date of Last Cleanup.- Windows Update installs the update that was failing for lack of space, and the PC restarts normally.
- If you turned hibernation off,
powercfg /asays hibernation has not been enabled andhiberfil.syshas gone from the root of C:.
Notes
- What not to delete by hand: the
WinSxSfolder or anything inside it (use DISM);hiberfil.sys(usepowercfg);pagefile.sys; andWindows.oldunless you are sure you do not want to roll back. Use the Settings, Disk Cleanup or DISM options for each. - Microsoft Store apps filling the Temp folder: if you get Low Disk Space errors after cleaning, Microsoft says the Temp folder can fill with app package files used by the Microsoft Store. Its fix is to run the Windows Store Apps troubleshooter, clear the Store cache with
wsreset.exe, run the Windows Update troubleshooter and restart. - Windows 10 only: Microsoft also documents compressing the operating system drive (right-click the drive, Properties, Compress this drive to save disk space) to gain space to install important updates, and decompressing it afterwards. It does not delete anything, but it is a stopgap, not a fix.
- Still not enough? Microsoft suggests moving personal files to an external drive, saving new files to another drive (Settings > System > Storage > Advanced storage settings > Where new content is saved on Windows 11), or, for a feature update, using external storage to install it.
- Related: if the drive was full because of a failed update, see How to repair Windows system files with SFC and DISM.
Microsoft sources used (checked 14 October 2026):
- Free up drive space in Windows: https://support.microsoft.com/en-us/windows/free-up-drive-space-in-windows-85529ccb-c365-490d-b548-831022bc9b32
- Manage drive space with Storage Sense: https://support.microsoft.com/en-us/windows/manage-drive-space-with-storage-sense-654f6ada-7bfc-45e5-966b-e24aded96ad5
- Clean up the WinSxS folder: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/clean-up-the-winsxs-folder
- Determine the actual size of the WinSxS folder: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/determine-the-actual-size-of-the-winsxs-folder
- DISM operating system package servicing command-line options: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/dism-operating-system-package-servicing-command-line-options
- cleanmgr command reference: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cleanmgr
- Powercfg command-line options: https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/powercfg-command-line-options
- System power states (hibernation file types): https://learn.microsoft.com/en-us/windows/win32/power/system-power-states
- How to disable and re-enable hibernation: https://learn.microsoft.com/en-us/troubleshoot/windows-client/setup-upgrade-and-drivers/disable-and-re-enable-hibernation
- Introduction to page files: https://learn.microsoft.com/en-us/troubleshoot/windows-client/performance/introduction-to-the-page-file
- vssadmin resize shadowstorage: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/vssadmin-resize-shadowstorage
- vssadmin list shadowstorage: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/vssadmin-list-shadowstorage
- Point-in-time restore for Windows: https://learn.microsoft.com/en-us/windows/configuration/point-in-time-restore
- Query and set Files On-Demand states in Windows: https://learn.microsoft.com/en-us/sharepoint/files-on-demand-windows
- Overview of OneDrive in Microsoft 365: https://learn.microsoft.com/en-us/sharepoint/onedrive-overview
- Get-ChildItem: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem
- Measure-Object: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/measure-object
- Bug checks (10 to 15 percent free space guidance): https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-checks–blue-screens-
Still full after all that? Post the output of DISM.exe /Online /Cleanup-Image /AnalyzeComponentStore and the top folders from the PowerShell size listing in The Patch Panel and we will work out where the space went. The best answer earns points on Top of the Stack.