Latest Posts

Most Popular Posts

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:

Related posts:

  1. Disabling Windows Search in Vista: Stop hard drive running constantly
  2. Print Directory Listing in Windows
  3. Speed up low memory system running Windows Vista
  4. Disable User Account Control (UAC) in Windows 7
  5. Slimming down Windows XP Pro SP2 Install


(average: 4.83 out of 5)

46 Responses to “Reduce Windows 7 WinSxS Folder Size”

  1. David
    June 26, 2011 at 2:31 am

    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.

    • Pluton
      August 14, 2011 at 8:07 am

      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….

      • uninspired
        September 16, 2011 at 11:36 am

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

  2. Markus
    July 1, 2011 at 4:57 am

    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

  3. Wayne
    July 14, 2011 at 2:18 pm

    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.

  4. Mark
    July 15, 2011 at 3:58 pm

    this worked like a champ i lost almost 10gb off the folder. thank you !!!

  5. July 19, 2011 at 11:19 am

    Worked great, went from 11.2 GB to 6.5 GB on my 64 bit Win7 (120 GB SSD)

  6. pavan
    July 20, 2011 at 2:56 am

    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….

    • August 8, 2011 at 8:02 pm

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

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

  7. Mike
    July 30, 2011 at 7:59 am

    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

    • August 8, 2011 at 8:10 pm

      Version: 6.1.7600.xxxxx is the RTM build of Windows 7. This trick works with Windows 7 SP1 which should be version: 6.1.7601.xxxxx.

  8. Schlock
    August 5, 2011 at 8:55 am

    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.

    • August 8, 2011 at 8:01 pm

      Yes, both work effectively. Using the command line is useful when you want to push this to a number of machines connected on a domain.

  9. Alx
    September 19, 2011 at 2:39 am

    Thanks a lot, it works fine – got rid of more than 2GB. Great help!

  10. Stan Snajberg
    September 21, 2011 at 11:05 am

    Thank you, great way to spare the SDD space

  11. Dan
    October 14, 2011 at 9:33 am

    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

    • Killer B
      November 2, 2011 at 9:46 am

      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?)

    • Kim
      November 3, 2011 at 7:33 pm

      I got the same error, Dan – I had to install SP1 in order for it to run.

    • November 3, 2011 at 11:01 pm

      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!

  12. Daya
    October 18, 2011 at 7:10 am

    Thanks to the post i have sames from 11gb to 6 gb

  13. Peter
    October 30, 2011 at 11:49 pm

    Thank you a lot, reclaimed 5 very valuable Gigabytes on my SSD, thank you again!

  14. nikola
    November 1, 2011 at 7:09 am

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

  15. swift
    November 8, 2011 at 9:42 pm

    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>

    • November 8, 2011 at 10:05 pm

      Version: 6.1.7600.xxxxx is the RTM build of Windows 7. This trick works with Windows 7 SP1 which should be version: 6.1.7601.xxxxx

      • Shawn
        January 31, 2012 at 2:20 am

        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.

  16. November 16, 2011 at 11:32 am

    Minus 3.4-3.5 GB.
    Thanks a million!

  17. ophii
    November 20, 2011 at 11:05 pm

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

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

    • November 23, 2011 at 9:09 pm

      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.

  18. Laura
    November 21, 2011 at 4:34 am

    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!!!!

    • November 23, 2011 at 9:10 pm

      Laura,

      Yes, you need to type in the following and then press ENTER:

      dism /online /cleanup-image /spsuperseded

  19. teja
    November 23, 2011 at 9:23 am

    Thanks a lot, it works fine reduced from 6.95 to 4.37

  20. Richard Dunne
    November 28, 2011 at 4:16 am

    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?

    • Anon
      January 1, 2012 at 9:32 am

      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)

      • Anon
        January 1, 2012 at 9:49 am

        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.

  21. Llamb
    November 30, 2011 at 6:50 pm

    This was awesome I went from 25 GB to nearly 9 GB of free space! Highly recommended A++

  22. Sam
    December 1, 2011 at 3:32 am

    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…

  23. Rikard
    December 5, 2011 at 1:21 am

    Thanks.. Went from 11.1 GB to 6.77 GB on my Win7 64bit with (120 GB SSD)

  24. Geir Atle Storhaug
    December 7, 2011 at 4:59 am

    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.

  25. Penny
    December 18, 2011 at 6:06 am

    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.

    • December 18, 2011 at 4:46 pm

      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.

  26. Alex
    December 24, 2011 at 8:12 am

    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…

    • January 12, 2012 at 5:42 pm

      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?

    • CLOX_
      January 16, 2012 at 1:58 am

      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.

  27. Trod
    December 28, 2011 at 11:17 am

    CCleaner takes care of this as well.

  28. floepie
    January 21, 2012 at 7:57 am

    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.

  29. pc
    February 2, 2012 at 5:22 pm

    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.

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


What do you use Virtualization for?

View Results

Loading ... Loading ...