How-To & Tips

How to Free Up Space on Windows With the DISM Command

Learn how to analyze and clean the WinSxS folder with DISM, Microsoft's own method for reclaiming gigabytes on Windows 10 and 11 safely.

By Redação IntelliTechs4 min read
Metallic storage drive with layers peeling away under cyan light

If your 256 GB or 512 GB SSD keeps running out of room, there’s a cleanup many people never try: the WinSxS folder, where Windows keeps older versions of its own components. In a test by MakeUseOf, one PC got back about 10 GB from a folder that was taking 22 to 24 GB. Results vary by PC, but the method is the one Microsoft recommends, and it uses tools already built into Windows.

What is the WinSxS folder?

WinSxS (short for “Windows Side by Side”) lives at C:\Windows\WinSxS and works as the component store. It holds installation files and earlier copies of system parts. Each update brings new versions in, and the old ones stay for a while so you can roll back an update that causes trouble.

That’s why the folder grows. According to MakeUseOf, it can reach 15 to 20 GB. There’s a catch, though: File Explorer overstates the real size, because many files are hard links, meaning pointers to a single copy rather than duplicates.

Important: Microsoft warns that deleting files from this folder, or the whole folder, can damage the system so badly that your PC won’t boot and can’t be updated. Never do it by hand. Use the commands below.

Step by step with DISM

DISM is a Windows command-line tool for servicing the system image. These steps work on Windows 10 and 11.

  1. Open the Start menu and type cmd (or PowerShell).
  2. Right-click the result and choose Run as administrator.
  3. To see how much you can recover, type this command and press Enter:
DISM.exe /Online /Cleanup-Image /AnalyzeComponentStore
  1. Read the output. It shows the size File Explorer reports and the actual size on disk. Look for the line “Component Store Cleanup Recommended.”
  2. If it says “Yes,” run:
DISM.exe /Online /Cleanup-Image /StartComponentCleanup
  1. Wait for it to finish. It can take a few minutes on PCs with a long update history. Don’t close the window.
  2. Restart your PC if Windows asks you to.

What the command actually removes

Per Microsoft, /StartComponentCleanup does the same work Windows already does on its own, with two differences: previous versions of updated components are deleted right away, with no 30-day wait, and there’s no one-hour limit like the automatic task has.

That’s the trade you make. In exchange for free space, you lose the easy way to uninstall recent updates. Help Desk Geek notes that you can’t roll back updates after the cleanup until the next update arrives, and that some apps relying on older library versions may misbehave. So the best time to run it is when your PC is working well, not right after an update you’re still testing.

What about /ResetBase?

There’s a more aggressive version:

DISM.exe /Online /Cleanup-Image /StartComponentCleanup /ResetBase

It removes all superseded versions of every component. Microsoft warns that after this, none of the updates already installed can be uninstalled (future ones still can). MakeUseOf doesn’t recommend it for average users. If all you want is space, stick with the command without /ResetBase.

Two other ways to run the same cleanup

Disk Cleanup. Open Disk Cleanup, choose to clean up system files, and tick the Windows Update cleanup option. Microsoft lists it as one way to shrink the component store.

Task Scheduler. Go to Task Scheduler Library > Microsoft > Windows > Servicing and run the StartComponentCleanup task. It waits at least 30 days after an update before removing old versions and has a one-hour timeout, so it may not clean everything. You can also start it with this command:

schtasks.exe /Run /TN "\Microsoft\Windows\Servicing\StartComponentCleanup"

Check what else is eating your drive

DISM only solves part of the problem. If the drive is still full afterward, open Settings > System > Storage to see which categories weigh the most. Photos, videos and downloads often take far more than Windows itself.

Keeping your system updated matters beyond disk space, too. WhatsApp, for example, now blocks login on outdated systems, as we reported here, and Android Auto may be ending support for older Android versions.

Frequently asked questions

Is it safe to run DISM?

Yes, as long as you use /StartComponentCleanup and run it as administrator. It’s a method described by Microsoft itself. What isn’t safe is deleting the WinSxS folder manually.

How much space will I get back?

It depends on your PC’s update history. MakeUseOf’s test freed about 10 GB. If the analysis says cleanup isn’t recommended, the gain will be small.

Do I need to do this every month?

No. Windows already has an automatic task that removes old components, with a minimum wait of 30 days after each update. The manual command is for when you need space now.

Can I uninstall an update after the cleanup?

With /StartComponentCleanup, you can’t roll back updates that were left behind until the next one arrives. If you want to keep that option, let Windows do the cleanup on its own schedule.