Feb 14

How to: cleanup the winsxs folder after SP1 installation on Windows 2008 R2

After the installation on SP1 on Windows 2008 R2 I have notice that lots of my server were getting low disk space. I scanned the C: drive with TreeSize Pro and I found out that the Winsxs folder was really big (between 9 and 16 Gb). There is a command that you can use to cleanup after the SP1 install.

WARNING: Once you run this command you will NOT be able to uninstall SP1.

To cleanup after the installation of SP1 follow these steps:
-Open an elevated command prompt (Right click “Command Prompt” and select “Run as administrator”
-Run this command (It does not require a reboot):

DISM.exe /online /Cleanup-Image /spsuperseded /hidesp

-The operation should take about 10 to 15 minutes. Once completed you will see: “The operation completed successfully”

/Online: Targets the running operating system.
/Cleanup-Image: Performs cleanup and recovery operations on the image
/spsuperseded: Remove SP backup and unused files
/hidesp: Optional – Hide the service pack from Installed updates

I have use this command on multiple servers without any issue. I was able to save between 2 and 6 Gb. Most of my server are virtual servers running on VMware and created using the same template. For some reason the amount of space that was clean was still different for each servers.

Use this command at your own risk, you should also backup or snapshot your server before running this.

Comment this article to let me know how much space you got back after running the cleanup.

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>