Clean Up the System Drive on Windows 2008 R2

As most system administrators are aware, conflicting DLLs were an issue with versions of Windows before the release of Windows Server 2008.  That issue was resolved with Windows 2008 although it created a new issue:  the winsxs folder and the fact that it continues to grow over time.  Thankfully there is a way to reclaim some of the winsxs disk space on Windows 2008 R2.

The first step is to download and install the following update on your Windows 2008 R2 server.  It is a small update and does not require a reboot.

http://www.microsoft.com/en-us/download/details.aspx?id=42739

The next hurdle is finding a way to run Disk Cleanup on the server.  Most references will direct you to install the Desktop Experience feature on the server.  This is really not a good option on a production server as it also installs other features that are not needed when all we want to do is clean up the system drive.

Fortunately there is a workaround for this.  Open up Windows Explorer and navigate to this folder:

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da

You will see cleanmgr.exe located there.  Copy that file to C:\Windows\system32\.  Next navigate to this folder:

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63

You will see cleanmgr.exe.mui located there.  Copy that file to C:\Windows\System32\en-US\.

Now from a command prompt or the Start menu, you can run cleanmgr.exe.  It will now scan your C: and prompt you to cleanup files afterwards.  You will note that there is now an option to clean up Windows Update files.  Select those, accept the prompt to delete the files, and it will clean up any unneeded Windows Update files.

When it is finished, it will just close with no prompt.  You will note that you need to reboot the server in order to complete the process.  Allow an extra few minutes for Windows to finish cleaning up those files after the reboot.

Here is the reference for the location of cleanmgr.exe and cleanmgr.exe.mui:

https://technet.microsoft.com/en-us/library/ff630161%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396