How to Run Disk Cleanup (Cleanmgr.exe) on Windows Server 2016/2012 R2/2008 R2

The Disk Cleanup instrument permits the administrator to rapidly clear up the Windows Server system drive by deleting pointless and momentary recordsdata, together with cleansing the listing from recordsdata of outdated parts that remained after putting in the latest cumulative updates. The Disk Cleanup utility (cleanmgr.exe) is put in by default on the GUI editions of Windows Server 2016/2019 (Desktop Experience). However, in earlier variations of Windows Server (2012 R2/2012/2008 R2), the cleanmgr.exe instrument is lacking.

Using Disk Cleanup Tool on Windows Server 2016

To clear the system disk from unneeded recordsdata on Windows Server 2016 utilizing the Disk Cleanup utility, you want to open the disk properties in File Explorer and click on the Disk Cleanup button.

You can even kind the “disk cleanup” or cleanmgr.exe within the search field.

Select the drive you need to clear.

Wait till the cleansing wizard checks your disk and finds pointless recordsdata that may be safely deleted.

You can choose parts whose recordsdata might be deleted. You are prompted to delete the next momentary recordsdata:

  • Setup Log Files;
  • Downloaded Program Files;
  • Temporary Internet Files;
  • Recycle Bin;
  • Temporary recordsdata;
  • Thumbnails.

To take away unneeded system recordsdata, click on on the Clean up system recordsdata button.

Additionally, it’s proposed to clear up:

Select the choices you want, and Disk Cleanup will present the quantity of disk area you gave. Click OK and ensure the deletion of recordsdata.

Wait for the cleanmgr.exe instrument to take away the pointless recordsdata.

Cleanmgr.exe: Disk Cleanup Command-Line Options

The cleanmgr.exe instrument has a number of command-line choices that enable it to be utilized in numerous computerized drive cleansing situations. They can be utilized each on Windows Server and on person desktop workstations working Windows 10.

cleanmgr.exe [/d driveletter] [/SAGESET:n | /SAGERUN:n | TUNEUP:n | /LOWDISK | /VERYLOWDISK | /SETUP | /AUTOCLEAN]

The /AUTOCLEAN parameter is used to delete previous recordsdata left after upgrading a Windows construct. The /SETUP possibility permits you to delete recordsdata left from a earlier model of Windows (when you carried out an in-place improve).

The cleanmgr /LOWDISK command runs the Disk Cleanup GUI with the already chosen cleansing choices.

The cleanmgr /VERYLOWDISK command performs computerized drive cleanup (with out displaying GUI), and after the tip it shows details about the actions carried out and out there free area.

You have efficiently resolved the low disk area situation. Your C: quantity now has 10000 Mb of free area remaining.

Using the /sageset:xx and /sagerun:xx choices, you’ll be able to create and run a personalized set of cleanup choices.

For instance, run the command: cleanmgr /sageset: 11. In the window that opens, choose the parts and recordsdata that you really want to robotically cleanup (I chosen all of the choices).

These settings are saved to the registry key HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerVolumeCaches. This registry part lists all of the Windows parts that may be cleaned utilizing the Disk Cleanup instrument. For every possibility you choose, a DWORD parameter is created with the title StateFlags0011 (0011 is the quantity you specified within the sageset parameter).

To begin the drive cleanup activity with the chosen parameters, run the command:

cleanmgr /sagerun:11

If you want to configure computerized disk cleanup activity on computer systems (or servers) in an Active Directory area, you simply want to export this registry key and .

To robotically cleanup the system drive on workstations with Windows 10, you’ll be able to with the next PowerShell code:

Start-Process -FilePath CleanMgr.exe -ArgumentList '/sagerun:11' -WindowStyle Hidden -Wait

How to Enable Disk Cleanup on Windows Server 2012 R2/2008 R2 with out Installing Desktop Experience?

By default, in Windows Server 2012/R2 and 2008/R2 the Disk Cleanup (cleanmgr.exe) instrument isn’t put in by default. To use the cleanmgr utility, first you could have to set up a separate server Desktop Experience characteristic utilizing both Server Manager or PowerShell (Install-WindowsFunction Desktop-Experience).

Together with Desktop Experience, many different pointless parts are put in on the server:

  • Windows Media Player;
  • Desktop themes;
  • AVI assist for Windows;
  • Windows SideShow;
  • ;
  • Disk Cleanup;
  • Sync Center;
  • Audio recording;
  • Character Map;
  • Snipping Tool.

To run the Disk Cleanup on Windows Server, you should utilize a easy methodology: simply copy two recordsdata Cleanmgr.exe and Cleanmgr.exe.mui from WinSxS to the system32 listing. Below you’ll be able to see instructions to copy cleanmgr recordsdata in numerous Windows variations (in all circumstances, the trail is used for Windows Server English language editions).

OS model Command to copy cleanmgr bin recordsdata
Windows Server 2008 R2 x64


copy C:Windowswinsxsamd64_microsoft-windows-cleanmgr_31bf3856advert364e35_6.1.7600.16385_none_c9392808773cd7dacleanmgr.exe C:WindowsSystem32
copy C:Windowswinsxsamd64_microsoft-windows-cleanmgr.resources_31bf3856advert364e35_6.1.7600.16385_en-us_b9cb6194b257cc63cleanmgr.exe.mui C:WindowsSystem32en-US
Windows Server 2008 x64


copy C:WindowsSystem32
copy C:WindowsSystem32en-US
Windows Server 2012 x64


copy C:WindowsWinSxSamd64_microsoft-windows-cleanmgr_31bf3856advert364e35_6.2.9200.16384_none_c60dddc5e750072acleanmgr.exe C:WindowsSystem32
copy C:WindowsWinSxSamd64_microsoft-windows-cleanmgr.resources_31bf3856advert364e35_6.2.9200.16384_en-us_b6a01752226afbb3cleanmgr.exe.mui C:WindowsSystem32en-US

Windows Server 2012 R2 x64

The trick described above doesn’t work on Windows Server 2012 R2 due to the modifications made by KB2821895 replace. The matter is that after you put in this replace, compression is used to retailer the binary element recordsdata. When you attempting to run the copied cleanmgr.exe, the next error seems:

Unsupported 16-Bit Application

The Program or characteristic ??C:Windowssystem32cleanmgr.exe can't begin or run due to incompatibility with 64-bit model of Windows.

As a workaround, you should utilize this methodology:

  1. Install Desktop Experience characteristic utilizing PowerShell: Install-WindowsFunction Desktop-Experience
  2. Restart your server;
  3. Copy the recordsdata %windirpercentsystem32cleanmgr.exe and %windirpercentsystem32en-UScleanmgr.exe.mui to any listing (c:temp);
  4. Uninstall the characteristic: Uninstall-WindowsFunction Desktop-Experience
  5. Reboot;
  6. Copy the recordsdata cleanmgr.exe and cleanmgr.exe.mui to the directories talked about above.

Later each of the recordsdata might be copied to different servers or built-in into your Windows Server 2012 R2 digital machine template.

To begin the Disk Cleanup instrument, run the cleanmgr.exe command with the administrator privileges.

Tip. You can use the command to delete outdated element recordsdata left after putting in updates on Windows Server R2:

dism.exe /on-line /Cleanup-Image /StartElementCleanup /ResetBase

To use cleanmgr.exe to delete previous replace recordsdata on Windows 2008 R2 / Windows 7 SP1, you want to set up a separate patch

Using Disk Cleanup on Windows Server Core Edition

In Windows Server Core 2016, which lacks a full-fledged GUI capabilities, Disk Cleanup instrument can be not put in. If you need to use cleanmgr.exe to clear up the disk on Server Core, simply copy the next recordsdata from the WinSXS listing:

copy C:WindowsSystem32copy C:WindowsSystem32en-US

Check Also

How to Use Native SSH Client in Windows 10?

The built-in SSH shopper appeared in Windows 10 and Windows Server 2019. Ssh.exe can be …

Leave a Reply

Your email address will not be published. Required fields are marked *