Sometimes it is convenient to cleanup some disk space by deleting unneeded files like service pack files, the temporary folder an so on. On Windows 7 workstation, you have the Disk Cleanup Utility to do this:
By default, this tool is not enabled on Windows Server 2008 R2. To enable it, there are two possibilities:
-
- (Not recommended) Install the Desktop Experience feature. I don’t recommend this as installing the Desktop Experience feature will not only install Disk Cleanup, but a lot of other utilities you likely don't need on a server (sound recorder, desktop themes, etc). Also, installing the Desktop Experience feature will require a reboot of your server.
- (Recommended) Copy 2 files to specific system folders and you can immediately use the tool:
Copy Cleanmgr.exe to %systemroot%\System32.
Copy Cleanmgr.exe.mui to %systemroot%\System32\en-US.
The 2 files are located in
- C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe
- C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui
You can then start the tool by executing Cleanmgr.exe
Update: John highlighted in the comments:
If "Windows Update Cleanup" is missing from the cleanup tool then you will also need the following KB installed if not already done so - https://support.microsoft.com/en-gb/kb/2852386
This will allow you to cleanup the WinSXS folder of any superseeded updates.
They only have one for Windows 2008 R2 SP1.
Anyone know where to find for SP2?
For Windows 2008 R2, there is no SP2. Only SP1 is available.
Perfect- thanks for the comment/quick Batch script for easy installation. Preferred over installing all of the Desktop Experience junk, too, especially when we just want to reclaim disk space.
I've tried to copy those 2 files on system32 however it doesn't run on my server 2008 r2 standard
What do you mean by "it doesn't run"? Are you getting an error message?
Great Post - Thank you
Worked for me as well...thanks a lot
Note: If "Windows Update Cleanup" is missing from the cleanup tool then you will also need the following KB installed if not already done so - https://support.microsoft.com/en-gb/kb/2852386
Reboot, Then its disk cleanup/system cleanup
Good call. I have added that to the original post.
Thanks.
I am trying to delete WinSxS directory/ windows update file but Windows Update Cleanup option is not show in disk Cleanup utility i also run through administrator but option not show desktop experience role is also installed kindly tell me how i remove old window upadates file in WinSxS directory
Did you get any response on this? I have the same issue.
You have to install a Windows update:
https://support.microsoft.com/en-gb/kb/2852386
to get the option for the "Windows Update Cleanup".
Cool. I like the second method. I have created a batch file based on your instruction:
Copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe %systemroot%\System32
Copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui %systemroot%\System32\en-US
cleanmgr.exe
THANK YOU!!!
Thanks. Working fine.
Thank you worked like a charm and that extra 3.5GB to help hold it over until the older servers can be migrated to 2012R2 really helps.
Thanks!
Can this work with Windows 2003 server?
On Windows 2003 Server, this utility is already installed by default. Just right-click on the C: drive, choose "Properties" and click on "Disk Cleanup".
is there any other tools for cleaning junk in Windows server r2?
CCleaner is a good app
Thank you. Very good post.
This is very useful. Thanks.