Windows Server 2008 is something every admin likes to work with (sense the sarcasm over the Internet, Dr Cooper?).

The Problem

Believe me or not, but an essential (Windows) tool, cleanmgr.exe, is not present in Windows Server 2008 and Windows Server 2008 R2 by default.

This is by Microsoft’s, at the very least hard-to-explain, design, who likely believe it’s more of a desktop experience feature than a must-have tool.

Why on Earth would I want to install Windows Photo Gallery and Windows Media Player on a server just to have Disk Cleanup? Moreover, it requires a server restart.

Bonus: if you want to use WebClient service, you need to have Desktop Experience feature installed too.

The Solution

Windows Server 2008 (64-bit)

Copy the following files:

> copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.0.6001.18000_none_c962d1e515e94269\cleanmgr.exe C:\Windows\System32\

> copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.0.6001.18000_en-us_b9f50b71510436f2\cleanmgr.exe.mui C:\Windows\System32\en-US\

Run the cleanmgr.exe:

> cleanmgr.exe

Windows Server 2008 R2 (64-bit)

Copy the following files:

> copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe C:\Windows\System32\

> copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui C:\Windows\System32\en-US\

Run the cleanmgr.exe:

> cleanmgr.exe