Posted by & filed under Windows / Server.

With Windows Vista, the WinSxS folder was able to be cleaned up via a third party tool (WinSxS Lite here – Vista only!). With the initial release of Windows 7, we lost that capability – but it has since returned with Service Pack 1.

The WinSxS folder is used to store install and uninstall files, windows packages (current and previous versions of a component) and out-of-band releases. You should not completely delete this folder. Post Windows 7 SP1, there is now a way to remove the unnecessary files from this folder using the command line (elevated/admin mode -> Click Start -> Type “cmd” in Search. Right click on “cmd” and choose “Run as Administrator”). This is great for reducing the Windows folder size for SSDs and netbooks. In my case it saved 3.5GB of space.

 

dism /online /cleanup-image /spsuperseded

 

 

Before:

 

After:

81 Responses to “Reduce Windows 7 WinSxS Folder Size”

  1. David

    I run an SSD on my laptop and my winsxs folder went from 10.5GB to 6.25GB! Thanks!

    Just one pointer. Your article assumes that you are running a 32-bit Windows version. If you run the dism command on a 64-bit instance you get this error:

    Error: 11

    You cannot service a running 64-bit operating system with a 32-bit version of DISM.
    Please use the version of DISM that corresponds to your computer’s architecture.

    The trick is to go to the sysnative directory (usually c:\windows\sysnative) and run the command from there.

    Thanks again for the tip.

    Reply
    • Pluton

      For 64 bit systems, I can confirm that the launch of dism from \Windows\System is required to effectively save the 4GB. Otherwise (from Windows\System32) there’s no error but you almost save nothing….

      Reply
      • uninspired

        I’m running 64-bit version (Win7 Professional) and I ran it from c:\users\xxx and it worked just fine.

  2. Markus

    Thanks Chris!

    Worked like a charm and freed up 3.3 GB on my SSD.
    Seems to me that *everything* you run on a Win7 PC will increase the size of the WinSxS folder. Even a portable software that you run once and then remove. Since I found out, am using a VM to try new software…

    Markus

    Reply
  3. Wayne

    Just ran ‘dism /online /cleanup-image /spsuperseded’ on Windows 7 Enterprise 64bit. Reduced ‘winsxs’ folder from 10.64gig down to 6.56gig

    Rebooted and all is fine.

    Reply
  4. pavan

    following error is coming windows 7 ultimate 64 bit
    Error: 87

    The cleanuo-image option is unknown.
    For more information, refer to the help by running DISM.exe /?

    Please help….

    Reply
    • Chris Stinson

      You have a spelling error in your syntax: “The cleanuo-image option is unknown.”

      You had typed: “cleanuo” instead of “cleanup”

      Reply
      • Kumar

        My syntax is correct but still getting Error:87

        Note: i dont have SP1 installed

  5. Mike

    c:\Windows\System32>dism /online /cleanup-image /spsuperseded

    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385

    Image Version: 6.1.7600.16385

    Service Pack Cleanup can’t proceed: No service pack backup files were found.
    The operation completed successfully.

    This is with the sxs folder at 6.32GB

    Reply
  6. Schlock

    In the Disk Cleanup tool under administrative tools there’s an option to clean up Service Pack Backup Files, which seems to do exactly the same thing as this.

    Reply
  7. Dan

    I keep getting

    Error: 11

    You cannot service a running 64-bit system with a 32-bit version of DISM.
    Please use the version of DISM that corresponds to you computer’s architecture.

    The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

    I’ve tried running cmd.exe from SysWOW64 but i couldn’t find sysnative.

    I also tried changing the directory in cmd.exe to sysnative.
    This gave error: 87

    The spsuperseded option is not recognised in this context.
    For more information, refer to the help.
    The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

    Not sure what i’m doing wrong. My hardrive is partitioned with windows installed on a 30gb section and the winsxs file is ~12gb so the partition is nearly full. Any help would be really appreciated.. ;(

    Thanks

    Reply
    • Killer B

      Dan: run it from C:\windows\system32. C:\windows\syswow64 has native 32-bit items in it, whereas C:\windows\system32 has native 64-bit items in it (confusing, huh?)

      Reply
    • DJAY

      i have the same problem.
      i guest this error is from the install kitt.
      i install disk windows 7SP1
      and this trick does`nt work!

      Reply
  8. nikola

    ran it from \windows\system32 on Win 7 professional 64bit and saved around 6.4 GB of disk space

    Reply
  9. swift

    can i just manual go into the winsxc folder and delete stuff? the command above keeps giving me:

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Windows>dism /online /cleanup-image /spsuperseded

    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385

    Image Version: 6.1.7600.16385

    Error: 87

    The spsuperseded option is not recognized in this context.
    For more information, refer to the help.

    The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

    C:\Windows>

    Reply
      • Shawn

        This doesn’t really help. I received the same error message and I am running Windows 7 Ultimate SP1 Retail. The ver command returns 7601 but the dism tool version is 7600.

    • Vinay Kumar

      C:\Windows\system32>dism /online /cleanup-image /spsupersseded

      Deployment Image Servicing and Management tool
      Version: 6.2.9200.16384

      Iage Version: 6.2.9200.16384

      Error: 87

      The spsupersseded option is not recognized in this context.
      For more information, refer to the help.

      The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

      Reply
  10. ophii

    Just ran on my Win7 machine. Awesome, Thanks : )

    Now what about using on Server 2008 R2?
    Safe?
    Untested?

    Reply
    • Chris Stinson

      2008 R2 SP1 will work, but I don’t think Microsoft will like it, or support it.

      I would recommend against it if you haven’t thoroughly tested your configuration or you aren’t sure that you won’t have compatibility issues with SP1 in the future.

      Reply
  11. Laura

    I right clicked the CMD and run as administrator but it doesn’t do anything. Do I have ti type in a comand or something. I really need the help!!!!

    Reply
  12. Richard Dunne

    I just tried to run this in both the system and system32 folders and got the following error message in both cases:

    “Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385

    Image Version: 6.1.7600.16385

    Removing backup files created during service pack installation.

    Error: 0x8004231f

    DISM failed. No operation was performed.
    For more information, review the log file.

    The DISM log file can be found at C:\Windows\Logs\DISM\dism.log”

    Although the version shows as 6.1.7600 and not 6.1.7601 the OS is Windows 7 Pro SP1.

    Any ideas why DISM failed and what I can do to make it run?

    Reply
    • Anon

      I’ve got the same error. You do not have enough disk space for creating Restore Point while performing this operation(see log file for details)

      Reply
      • Anon

        I’ve got Image Version: 6.1.7600.16385.
        I had about 200 Mb free on C:\, freed up to 700 Mb, and while processing, my free space reduced to 300 Mb.
        Total freed space – 3Gb.

  13. Sam

    Haven’t read all the comments so it may already have been said but be aware that after you do this you cannot uninstall the SP…

    Reply
  14. Geir Atle Storhaug

    All computers I have tried this on (OK, only two, but both running Windows 7 Professional, SP1), report:

    ————————————
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Windows\system32>dism /online /cleanup-image /spsuperseded

    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385

    Image Version: 6.1.7600.16385

    Service Pack Cleanup can’t proceed: No service pack backup files were found.
    The operation completed successfully.
    ——————————–

    Notice that the shell reports 6.1.7601, while the dism command reports version 6.1.7600.16385.

    Reply
  15. Penny

    I tried the command I received:

    Error: 112

    An error occurred accessing the temporary folder C:\Users\owner\AppData\Local\Te
    mp\92A7CEF5-CA21-4E0B-98EF-FB18F36EFD80.
    Ensure that the path to the temporary folder exists and that you have Read/Write
    permissions on the folder.

    The DISM log file can be found at C:\windows\Logs\DISM\dism.log

    My c drive currently has about 480kb free out of a 58.5 GB drive. There were no problems until about a month ago and the problem was just “all of a sudden” there was no room.

    Reply
    • Chris Stinson

      Are you running the command from within a temporary folder? Or can you see C:\Windows\System32 at the left of the command prompt?

      You can also go to:

      Start -> All Programs -> Accessories -> System Tools -> Disk Cleanup

      And try removing some other temporary files including browsing history and downloaded files.

      Reply
  16. Alex

    Ok i’ve this error

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Windows>dism /online /cleanup-image /spsuperseded

    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385

    Image Version: 6.1.7600.16385

    Error: 87

    The spsuperseded option is not recognized in this context.
    For more information, refer to the help.

    The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

    Is there a way to use this on a RTM too? Please my GB are more than 10 and i’ve only 1 Gb free on my 28 GB SSD…

    Reply
    • Yehoshua

      Yep. I’ve got the same problem as Alex. I don’t believe that I’ve installed SP1. Does this command only clean out a service pack, or can it scrub away the bloated junk out of my swollen winsxs folder anyways?

      Reply
    • CLOX_

      I made the same mistake:

      when you have typed in cmd, a new window opens. Right click on the top line where it says cmd, then select run as administrator.

      It works fine after that. Went for 10.6G to 7G.

      Reply
  17. floepie

    Hi everyone with errors,

    What you need to do is first change your UAC settings the default settings (move the slider up to the 2nd from the top). Then, reboot! Then, right click on ‘cmd’ to run as administrator even if your current user has admin rights. Then, follow instructions from above. Hope that solves things.

    Reply
  18. pc

    Tried on Win 7 HP 64 bit. Get following error – doesn’t work !
    C:\Windows\system>dism /online /cleanup-image /spsuperseded

    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385

    Image Version: 6.1.7600.16385

    Service Pack Cleanup can’t proceed: No service pack backup files were found.
    The operation completed successfully.

    C:\Windows\system>cd \Windows\System32

    C:\Windows\System32>dism /online /cleanup-image /spsuperseded

    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385

    Image Version: 6.1.7600.16385

    Service Pack Cleanup can’t proceed: No service pack backup files were found.
    The operation completed successfully.

    Reply
  19. Jamesa

    Error 740

    Elevated permissions are required to run DISM.
    Use an elevated command prompt to complete these tasks.

    Reply
  20. Robin

    I have Windows 7 professional, I have just 600 MB space left on my C. For this limited space, I cant Install SP1 and dism /online /cleanup-image /spsuperseded is giving error 87.
    What to do??

    Reply
    • Doug

      Hi, I just got the same error message. You need to include a space after online etc.

      Reply
  21. jhelp32

    i don’t get it. i have sp1 (ran ‘ver’ before ‘dism’):

    >ver

    Microsoft Windows [Version 6.1.7601]

    >dism /online /cleanup-image /spsuperseded

    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385

    Image Version: 6.1.7600.16385

    Service Pack Cleanup can’t proceed: No service pack backup files were found.
    The operation completed successfully.

    Reply
  22. Huby

    Thank you sooo much! :)
    My winsxs folder went from 12 gigs to 7,7 gigs
    I think, it is still all too big, however, that was a good step, thanks!!!

    Reply
  23. Yogi

    I got a similar response to pc.
    I use Ccleaner with the additions installed by Ccenhancer, and I have most of the Microsoft options ticked for removal. I think this carries out cleaning of the same files, so you won’t now find any.

    Reply
  24. Leota Marson

    Anybody who relies on the cloud as their sole backup method is an idiot.

    Reply
  25. Glow

    I have Windows Vista and Microsoft Windows Version 6.0.6002. Any suggestions as to how I can reduce winsxs. I tried the command you mentioned bbut it did not work. I kept receiving ‘dism’is not recognized as an internal or external command.

    Any suggestions….? Please help.

    Reply
  26. Mohsin

    Thanks for this, saved upto 3.5 GB,
    Still size of winsxs folder size is 6.75GB, can i save more disk space?

    Reply
  27. Howard

    My windows directory was 24.4gigs and after doing this it dropped to 20.7 gigs. There was 10.7 gigs in the winsxs subdirectory and that dropped to 7.1 gigs.

    Reply
  28. Steve

    Confirmed this works on a Windows 2008 R2 Terminal Server as well, cleared up over 4Gb.

    Reply
  29. Damien

    thanks for this, it worked fine for me once i had enough free space to run the command, otherwise it just bombed out with an error to check the log.

    to run it i had to free up 450mb of free space, and when i ran the command, i got an addtional 3.5GB on my 60GB ssd.
    thanks again.

    Reply
  30. Lisandro

    Pure gold, I was able to reduce winsxs size by 13 GB. What in the hell is Microsoft thinking?

    Reply
    • grek

      well, they don’t THINK, they only SELL a product; and the quality of that product is a subject for a separate discussion.

      Reply
  31. Antonio

    +1

    You saved my day! Thanks for this, i was running several Windows 2008 R2 VM on SAS drives, each have reduced windows size from about 38GB (yeah, 38!! ) down to “only” 27GB.

    May you Hero have a nice day! :D

    Reply
  32. bsuth

    This is one of the reasons why Windows is the worst OS out there. What a joke- a system folder that just keeps growing and growing.

    But thank you Chris for freeing up some space on my Win VM7 :)

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>