Disk Cleanup option on drive’s general properties and cleanmgr.exe is not present in Windows Server 2008 or Windows Server 2008 R2 by default.So in order to use cleanmgr.exe you’ll need to copy two files that are already present on the server, cleanmgr.exe and cleanmgr.exe.mui.
- Copy “C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe” to “%systemroot%\System32”
- Copy “C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui” to “%systemroot%\System32\en-US”
Now you can launch the Disk cleanup tool (cleanmgr.exe) from the command prompt.
You could also install the “Desktop Experience” feature this would also work, but why install something if you don’t need it, specially on a server.
More on this on TechNet
Tags: cleanmgr, disk cleanup, Microsoft, Windows Server, Windows Server 2008 R2 Last modified: October 17, 2011
I found that with quotes your commands won’t work.
If you simply do the following, running Command Prompt as Administrator, it should work without issue:
copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui %systemroot%\System32\en-US\
copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe %systemroot%\System32\