Dism.exe /online /Cleanup-Image /StartComponentCleanup to shrink the Windows component store, run Disk Cleanup (cleanmgr), and delete old IIS logs, memory dumps and application backups. Never delete files from C:\Windows\WinSxS by hand. If the disk was enlarged, extend C: with Resize-Partition.
Before you start
- Run the commands in PowerShell as Administrator (or an elevated Command Prompt where shown).
- Take a backup or snapshot before you delete anything you are unsure about.
- A completely full C: drive can stop Windows from signing you in over RDP. Use the VNC console on a VPS.
How to see what fills the drive
Check free space:C:\Users or C:\inetpub) to drill down. A large C:\Windows folder is normal.
Cause 1: the Windows component store has grown (WinSxS)
After many updates, old component versions stay inC:\Windows\WinSxS.
Check: in an elevated Command Prompt:
Component Store Cleanup Recommended : Yes, clean it.
Fix:
/ResetBase:
Cause 2: temporary files, update files and old logs
Fix: use Disk Cleanup. Choose what to clean once, then run it:/sageset:1 opens Disk Cleanup Settings where you tick the categories (for example temporary files and Windows Update files). /sagerun:1 runs that selection on every drive. To clean only C: with default settings, run cleanmgr /d C.
Also empty the Recycle Bin and clear the Downloads folders of user profiles under C:\Users.
Cause 3: IIS logs
If you run IIS, it writes logs toC:\inetpub\logs\LogFiles and doesn’t delete old ones on its own.
Check: run the folder-size command on C:\inetpub\logs\LogFiles.
Fix: delete logs older than 30 days:
-WhatIf to delete. Add it to Task Scheduler to keep logs in check.
Cause 4: memory dumps after crashes
After a blue screen, Windows can write a full memory dump toC:\Windows\MEMORY.DMP, which can be as large as the server’s RAM.
Fix: if you don’t need it for troubleshooting, delete it:
Cause 5: your own data
Database backups, game server backups, uploaded files and application logs are the most common reason a server fills up. Move them to another disk, delete old copies, or keep backups off the server: see back up a Windows server.How to extend C: after adding storage
If you upgraded the disk size, Windows doesn’t use the new space until you extend the partition. On a VPS, see view and manage VPS storage.diskmgmt.msc), right-click C: and choose Extend Volume.
How to check it worked
RunGet-PSDrive -Name C again. Leave enough free space for the next cumulative update to download and install.
Frequently asked questions
What is the WinSxS folder?
It is the Windows component store, which Windows uses to install, update and repair system files. Shrink it only with the DISM commands above.Is it safe to delete C:\Windows\Temp?
Use Disk Cleanup (cleanmgr) for temporary files instead of deleting them by hand.
Why is the drive full again after updates?
Each cumulative update adds new component versions. RunStartComponentCleanup after major updates, or let Windows run the scheduled task Microsoft\Windows\Servicing\StartComponentCleanup.
Related guides
VPS and dedicated server guides
Every guide in this section.
Repair Windows with SFC and DISM
Fix a damaged component store.
Windows Update stuck or failing
Low space often breaks updates.
Back up a Windows server
Keep backups off C:.
VPS storage
Disks in the VPS panel.
Checked against Microsoft Learn: Clean up the WinSxS folder, Determine the size of the WinSxS folder, cleanmgr, Managing IIS log file storage and Resize-Partition on 4 November 2026. Commands were not tested on a live Windows server for this page.
Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026