Windows OS Hub
  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange

 Windows OS Hub / Windows Server 2008 R2 / Disk Cleanup on Windows Server 2012 / 2008 Without Installing Desktop Experience

February 23, 2017 Windows Server 2008 R2Windows Server 2012 R2

Disk Cleanup on Windows Server 2012 / 2008 Without Installing Desktop Experience

By default, in Windows Server 2008 / R2 and 2012 / R2 there is no Disk Cleanup (cleanmgr.exe) utility that allows to delete unused files and clean up the WinSxS folder and component store from the files of updates that are no longer required. To run it, first you have to install a separate server component Desktop Experience using either Server Manager or PowerShell (Install-WindowsFeature Desktop-Experience).

Tip. To use cleanmgr to delete deprecated updates on Windows 2008 R2 / Windows 7 SP1, install KB2852386.

Together with Desktop Experience, many other unnecessary components are installed on the server:

  • Windows Media Player
  • Desktop themes
  • AVI support for Windows
  • Windows SideShow
  • Windows Defender
  • Disk Cleanup
  • Sync Center
  • Audio recording
  • Character Map
  • Snipping Tool

Desktop Experience feature on Windows server 2012 R2

To run Disk Cleanup on Windows Server, you can use an easier method: just copy two files Cleanmgr.exe and Cleanmgr.exe.mui from WinSxS to system directory. You can see commands to copy these files in different Windows versions below.

Windows Server 2008 R2 x64

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\

Windows Server 2008 x64

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\

Windows Server 2012 x64

copy C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.2.9200.16384_none_c60dddc5e750072a\cleanmgr.exe C:\Windows\System32\

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\

To start Disk Cleanup, run cleanmgr.exe command with the administrator privileges. copy cleanmgr.exe on windows server 2008 r2

Windows Server 2012 R2 x64

The method described below doesn’t work in Windows Server 2012 R2 due to the changes made by KB2821895 update. The matter is that after you install this update, compression is used to store the binary files of the components. When trying to run the copied cleanmgr.exe, the following error appears:

Unsupported 16-Bit Application

The Program or feature \??\C:\Windows\system32\cleanmgr.exe cannot start or run due to incompatibility with 64-bit version of windows

Unsupported 16-Bit Application  The Program or feature \??\C:\Windows\system32\cleanmgr.exe cannot start or run due to incompatibility with 64-bit version of windows

As a workaround, you can use this method:

  • Install Desktop Experience: Install-WindowsFeature Desktop-Experience
  • Restart your server
  • Copy the files %windir%\system32\cleanmgr.exe and %windir%\system32\en-US\cleanmgr.exe.mui to any directory (c:\temp)
  • Uninstal the feature: Uninstall-WindowsFeature Desktop-Experience
  • Restart
  • Copy the files cleanmgr.exe and cleanmgr.exe.mui to the directories mentioned above

Later both of the files can be copied to other servers or integrated into Win 2012 R2 virtual machine templates.

Tip. To delete the obsolete updates in Windows Server 2012 R2, it’s easier to use the following DISM command:
dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase

0 comment
0
Facebook Twitter Google + Pinterest
previous post
Calculating the Number of Client Access Licenses (CAL) for Exchange Server
next post
Activating Windows Server 2016 with KMS Server

Related Reading

Integrating Windows Updates into Windows 10 Install Image

February 12, 2019

Copying Large Files over an Unreliable Network Using...

February 11, 2019

“The update is not applicable to your computer”:...

February 10, 2019

Fix: Clock Reverts to Wrong Time After Computer...

February 8, 2019

Fix: BSOD Error 0x0000007B on Boot on Windows...

February 7, 2019

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange
  • Windows 10
  • Windows 8
  • Windows 7
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2008 R2
  • PowerShell
  • VMWare
  • MS Office

Recent Posts

  • ESXi: Slow Disk Performance on HPE Gen8

    February 15, 2019
  • Integrating Windows Updates into Windows 10 Install Image

    February 12, 2019
  • Copying Large Files over an Unreliable Network Using BITS and PowerShell

    February 11, 2019
  • Fix: Clock Reverts to Wrong Time After Computer (Server) Reboot

    February 8, 2019
  • Fix: BSOD Error 0x0000007B on Boot on Windows 7 and Server 2008 R2

    February 7, 2019
  • How to Disable Automatic Driver Updates in Windows 10?

    February 6, 2019
  • WSUS Windows Update Error 0x80244010: Exceeded max server round trips

    January 31, 2019
  • Configuring SSO (Single Sign-On) Authentication on Windows Server RDS

    January 29, 2019
  • Unable to Start or Connect to Virtual Disk Service in Disk Management

    January 28, 2019
  • How to Inject Drivers into a Windows 10 WIM/ISO Install Image?

    January 15, 2019
woshub.com

Follow us

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Unable to Connect RDP: CredSSP Encryption Oracle Remediation
  • Fix: Can’t Boot After Accidentally Deleted System Reserved Partition
  • Windows.edb File Too Big – How to Reduce Size
  • Unable to Install Print Driver after KB3170455
  • How to Filter Event Logs by Username in Windows 2008 and higher
  • Remote Desktop Connection Error: Outdated entry in the DNS cache
  • GPO Logging Using Gpsvc.log in Windows 7
Footer Logo

@2014 - 2018 - Windows OS Hub. All about operating systems for sysadmins


Back To Top