Windows Server 2012 (R2) Disk Cleanup
This article introduces how to install, enable and run Disk Cleanup on Windows Server 2012 (R2). Use Disk Cleanup (cleanmgr.exe) to clear up and reclaim disk space.
Server 2012 Disk Cleanup utility
The same with other versions, Windows Server 2012 system C: drive is getting full after running a period of time. One of the solution is cleaning up disk space, delete unnecessary and junk files to reclaim disk space. To do this, Microsoft provides native utility – Disk Cleanup, which can be run via command or GUI program.
To free up disk space on Server 2012 (R2), Disk Cleanup is the first choice, because it is easy and fast, also able to delete most common types of junk files safely. There are 3rd party optimization programs, but the native Disk Cleanup utility is safer and powerful enough.
The same with Server 2008 Disk Cleanup, this utility is not installed by default, this is the reason why some people feedback that there is no disk cleanup in Server 2012, or report error: Windows cannot find ‘cleanmgr’. Make sure you typed the name correctly, and then try again.
How to install/enable Disk Cleanup on Server 2012
There are two options to add Disk Cleanup on Windows Server 2012 (R2): enable by copying files from WinSxS or install with Desktop Experience feature.
It is easy and fast by copying files to specific folder, but in some environment Disk Cleanup doesn’t work. By installing feature, Server 2012 Disk Cleanup is fully functional, but it requires reboot to complete installing the Desktop Experience component. Furthermore, many other unnecessary components will be installed on the server together with Desktop Experience, such as:
- Windows Media Player
- Desktop themes
- AVI support for Windows
- Windows SideShow
- Windows Defender
- Sync Center
- Audio recording
- Character Map
- Snipping Tool
I’ll introduce both methods one by one.
Enable Disk Cleanup without reboot
You just need to copy two files Cleanmgr.exe and Cleanmgr.exe.mui from WinSxS to system directory.
To Server 2012 R2, this copy method is invalid and you need to install. If you are not sure about your version, simply press Windows and R on your keyboard to start Run, type winver to press Enter to check.
Steps to enable Disk Cleanup on Windows Server 2012 x64:
Step 1: Put your mouse pointer to bottom left corner and the hidden Start menu will come out, right click it and select Command Prompt (Admin)
- Press Windows and F on your keyboard.
- Type cmd in the search box, click App and Command Prompt will pop up on the left.
- Right click Command Prompt and select Run as Administrator on the bottom.
Step 2: Copy the command below, paste in the command prompt window and press Enter to execute.
copy C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.2.9200.16384_none_c60dddc5e750072a\cleanmgr.exe C:\Windows\System32\
Step 3: Copy, paste and execute the second command:
copy C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.2.9200.16384_en-us_b6a01752226afbb3\cleanmgr.exe.mui C:\Windows\System32\en-US\
Install Disk Cleanup with Desktop Experience
As I said above, you cannot enable Disk Cleanup in Windows Server 2012 R2 by simply coping files, you have to follow the steps below to install Desktop Experience.
Click Server Manager on bottom left, and then click the 2nd option “Add roles and features“.
Simply click Next in the following 4 windows.
Click the triangle to unfold User Interface and Infrastructure, and then click the check-box in front of “Desktop Experience“.
It’ll pop up a window and ask you to add additional features, click Add Features on bottom.
Click Close when it finish, it requires reboot to complete installation and take effect.
How to run Disk Cleanup on Server 2012
There are two ways to launch Disk Cleanup on Windows Server 2012:
- Press Windows and R on your keyboard, type cleanmgr and press Enter.
- Select C: (or other) drive in the drop-down list and click OK.
- Open File Explorer, right click C drive and select Properties.
- Click Disk Cleanup in this window.
You won’t see this button if you just copy files of Cleanmgr.exe and Cleanmgr.exe.mui
No matter which way, it is very easy to free up disk space with Disk Cleanup on Windows Server 2012 (R2), simply click the check-box in front of the files that you want to delete and then click OK to execute.
My test server is new installed, so I can reclaim little space. To the servers that never or have not free up disk space for a long time, Server 2012 Disk Cleanup utility may helps you regain over 10GB disk space.
If you get only little space with Disk Cleanup, or the system C drive is created small, you’d better expand C drive to larger size. Otherwise, C drive will be full again shortly. In fact, even if you get 10GB free space, it will be eaten up quickly by new generated junk files.
With server partition software, you can shrink any data volumes to get Unallocated space, and then add into C drive. Operating System, programs and anything else keep the same.Download NIUBI Partition Editor and follow the steps in the video: