Jan 312020
 
Microsoft Windows Server Logo Image

While us pros usually stay away from this tool, it is needed sometimes. Recently I found myself in a situation where I wanted to run the “Disk Cleanup” Windows app, on a Windows Server 2019 VM running Server Core.

As you all know, Server Core has a limited GUI. You’re able to run things like a command prompt, Task Manager, notepad, and other limited things. I wanted to see if we could get Disk Manager running on it, because of it’s light UI I was thinking it may be possible.

How to install Disk Cleanup (cleanmgr.exe) on Windows Server 2019, Server Core edition

Two files are required for Disk Cleanup:

  • cleangmgr.exe – The Disk Cleanup executable
  • cleanmgr.exe.mui – I’m assuming this is the language files required for the application

The above files when installed, are stored here:

  • C:\Windows\System32\cleanmgr.exe
  • C:\Windows\System32\en-US\cleanmgr.exe.mui

When it comes to installing Disk Cleanup, you need to have those two files placed in their appropriate directories.

You can source these files from other servers (preferably running the same version of Windows Server), or you can snag the files from the WinSXS folder on a valid Windows install. An example of the WinSXS paths can be found below:

Windows Server 2016

  • cleanmgr.exe – C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_10.0.14393.0_none_9ab8a1dc743e759a\cleanmgr.exe
  • cleanmgr.exe.mui – C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_10.0.14393.0_en-us_8b4adb68af596a23\cleanmgr.exe.mui

After placing these files in their proper directory, you can open a command prompt and just type “cleanmgr” to launch the Disk Cleanup application.

These instructions also apply to the fully loaded version of Windows Server 2019 (full GUI), as well as previous versions.

  6 Responses to “Disk Cleanup on Windows Server 2019, Server Core Edition”

  1. Correction:

    C:\Windows\System32\en-US\cleanmgr.exe.mui

    When it’s in this folder it worked for me, not in the folder you mentioned.
    Thanks

  2. Nick, thanks for pointing that out, I made a typo! 🙂 Cheers!

  3. https://devblogs.microsoft.com/oldnewthing/20200922-00/?p=104252

    please try

    dism /Online /Cleanup-Image /StartComponentCleanup.

    it may help, no need a GUI any more.

    good luck and stay safe!

  4. This is cool but it does not clean system files.

  5. Hi Mike, you need to run it as Administrator to clean system files.

  6. Hi,

    i have the Problem like Mike.
    i can’t clean system files.

    How can i run it as Administrator on my Core Server.

    I am directly logged in as Administrator User buti still can’t see the System files.
    I only have three options:
    1. Delivery Optimization Files
    2. Device driver packages
    3. Recycle Bin

    I hope you have an idea.

    Regards Peter

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)