Just tried to get cleanmgr installed and working on a fresh 2012 R2 install. Copies CleanMgr.exe & CleanMgr.exe.mui across like done before but when it is run get error: The Program or feature \?system32\cleanmgr.exe cannot start or run due to incompatibility with 64-bit version of windows
6 Answers
You need to enable Disk Cleanup by installing theDesktop Experience
feature (see Enabling Disk Cleanup Utility in Windows Server 2012). The command line interface should still be available via the C:\Windows\CleanMgr.exe
executable.
I got back to my lab and tried grabbing CleanMgr.exe
and CleanMgr.exe.mui
from the x86 and WOW64 bit updates thinking that might fix the compatibility issue:
Copy-Item -Path C:\Windows\WinSxS\x86_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.3.9600.16384_en-us_f2763474b4405afa\cleanmgr.exe.mui -Destination C:\Windows\System32\en-US
Copy-Item -Path C:\Windows\WinSxS\wow64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.3.9600.16384_none_685740be65e399a2\cleanmgr.exe -Destination C:\Windows\System32
And the results...
Ah. The march of progress. I see two options. You can get ProcMon running and try to track down all the various DLLs in the WOW64 subsystem (maybe by doing a Desktop Experience
install on a throwaway server), you can try this method to remove the windows.old
directories if that's what is ailing you or you can follow Microsoft's officially supported albeit misguided recommendations and install it from the Desktop-Experience Windows Feature.
-
Yes but rather than installing the whole ridiculous Desktop Experience on a server it used to be possible to get cleanMgr working by copying the following files: copy \\HskServer\C$\Windows\WinSxS\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.3.9600.16384_none_5e02966c3182d7a7\cleanmgr.exe %SystemRoot%\System32\*.* copy \\HskServer\C$\Windows\WinSxS\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.3.9600.16384_en-us_4e94cff86c9dcc30\cleanmgr.exe.mui %SystemRoot%\System32\en-US\*.* – NickC Mar 11 '14 at 13:07
-
@NickC - Yep. That looks like the only way to do it on 2012 R2. – Mar 11 '14 at 17:12
-
They placed quite *too many* things in the Desktop Experience feature; you need to install it even to be able to have *THE SYSTEM ICONS ON YOUR DESKTOP*... – Massimo Sep 17 '16 at 17:04
I had the same problem as Keith described for W2K12 R2 SP1 server. My solution for this problem:
- Install the desktop experience feature.
- Then you can see in SystemRoot\System32\en-US\cleanmgr.exe.mui and in SystemRoot\System32\cleanmgr.exe the new "cleanmgr" files, which are bigger as the files in the Winsxs folder
- Copy these files to another folder e.g. C:\
- Remove desktop experience feature, this will delete the cleanmgr files from system32!
- Copy the cleanmgr files from your folder(step3) to the known system32 locations (step2)
- Now you can run cleanmgr.exe
I use this procedure for making vmware template machines, so i did this once and all other future w2k12r2 server will have the cleanmgr files already installed
- 91
- 1
- 1
-
The files you mention are not present after adding the "Desktop Experience" feature to Windows Server 2012 R2. – Michael Steele Jul 08 '15 at 15:57
Copying directly from the c:\windows\WinSxS
directory, although once supported, now no longer works as-is. This appears to be a change within Windows Server 2012 R2 Update 1
a quick view of the cleanmgr.exe
binary in a hex editor reveals that the C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.3.9600.17031_none_5e3588b0315d2219\cleanmgr.exe
file is no longer begins with the required magic header "MZ...", instead it starts with "DCN..." and the file is much smaller than the expanded version. This is why we are getting the "unsupported..." dialog box above.
This appears to a direct result of KB 2821985 improvement #2 - Adds a feature that compresses unused binary files and allocates free disk space to prepare Windows for future updates.
Still trying to figure out how to extract/uncompress the files programmatically. :^(
- 103
- 4
- 51
- 1
- 1
-
1That's "Delta Compression" - http://blogs.technet.com/b/askcore/archive/2014/03/27/what-s-new-in-windows-servicing-reduction-of-windows-footprint-part-2.aspx SxSExpand tool is able to decompress - http://forums.mydigitallife.info/threads/48613-Aunty-Mel-s-Cheap-And-Nasty-SxS-File-Expander-%28Updated-2013-09-29%29 I've just used it to decompress cleanmgr.exe and .mui on Server 2012 R2 Update1. – lbr Mar 02 '15 at 20:04
Copy-Item "C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.3.9600.16384_en-us_4e94cff86c9dcc30\cleanmgr.exe.mui" -Destination "$env:SystemRoot\System32\en-US\cleanmgr.exe.mui" -Force
Copy-Item "C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.3.9600.16384_none_5e02966c3182d7a7\cleanmgr.exe" -Destination "$env:SystemRoot\System32\cleanmgr.exe" -Force
I believe this is what you're looking for.
Comment by Nick was close to this, but this is a bit cleaner and uses $env rather than %env% variables (powershell likes $env better)
- 31
- 3
Someone has kindly provided a zip file containing the required files which unlike the steps above (not including installing the "desktop experience rubbish) actually works on Windows Server 2012 R2 64-bit.
You can read more from the author's page and get the download links yourself. It is a zip file that you expand onto your System drive and it puts the files where needed. There is also a link for the Windows 2008 version.
Quite why we have to go to such measures for such a simple thing as cleaning up the hard disk is a mystery to me.
UPDATE: I have opened a Windows Server user voice request here - if you think having disk clean-up installed is useful, please vote for it.
- 574
- 5
- 8
-
Anyway besides downloading the files from the author's page and installing them properly, the code to add the button to the properties page of the drive is this Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\cleanuppath] @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\ 00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,63,00,6c,00,\ 65,00,61,00,6e,00,6d,00,67,00,72,00,2e,00,65,00,78,00,65,00,20,00,2f,00,44,\ 00,20,00,25,00,63,00,00,00 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Micro – RNR1995 Sep 19 '16 at 12:27
-
@RNR1995 Welcome to Server Fault! To critique or request clarification from an author, please leave a **comment** below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://serverfault.com/help/whats-reputation) you will be able to [comment on any post](http://serverfault.com/help/privileges/comment). (comments are limited in length so I can't convert your answer properly either). – HBruijn Sep 19 '16 at 12:45
You can copy the Cleanmgr.exe and Cleanmgr.exe.mui from an updated Windows 8 to the server.