How to run disk cleanup without desktop experience (Server 2008+R2)

A little thing that sometimes bothers me when I'm doing maintenence on Windows servers based on 2008 and 2008R2 is that you need to install the Desktop Experience feature in order to get access to bloody Disk Cleanup.

Well kids, today I'm going to show you how to bypass that entire mess, this will be a fairly quick post.

Basically, get yourself an administrative command prompt open and do the following:

Windows Server 2008 Based

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

Then

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\

You should then be able to (within an elevated cmd) run cleanmgr.exe.

Windows Server 2008 R2 Based

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

Then

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\

You should then be able to (within an elevated cmd) run cleanmgr.exe.

See, it's fairly straight forward, you don't need to bundle your server with fucking Windows Media Player, and it also doesn't require a reboot.

R