how to purge windows update on server 2008 r2

server 200r2 is out of disk space on C: I have moved everything that was easy to move on to D:
As a result of an avalanche of Microsoft updates last night the Winsxs directory now contains 18Gb.
ccleaner.exe and/or 'Disk Cleanup' only recovers small amounts which are immediately eaten by processes on the system.
I have KB2852386 and installed desktop experience.
When I run 'disk cleanup' it identifies 6.2Gb of update files which it says can be removed.
Then I have to reboot at which point I get "Failure configuring windows updates" and it all rolls back again.
I disabled the windows update service and then I deleted the WU download folder as well, but none of this makes any difference.
To make some space I uninstalled all the office updates which were delivered yesterday.
How can I make 'Disk Cleanup' do what it is supposed to do and free up 6.2Gb?
I tried running a downloaded script 'cleanup-disk.ps1' but all it seemed to do was display its contents in editor.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
I tried running a downloaded script 'cleanup-disk.ps1' but all it seemed to do was display its contents in editor right click and run in powershell
you may have to open powershell as an administrator and then run the file If you haven't configured powershell scripts will not run by default from an administrative powershell session you need to run
set-executionpolicy remotesigned  (there are many options but this is what I suggest) and then press Y to allow it to change the execution policy
You really need to add more space for windows add at least 30% more space (you are probably aware of this but don't want to do it)
peter_lawrieAuthor Commented:
Thank you.
I managed to run the cleanup-disk.ps1 as you advised, using powershell.
However, all it seemed to do was reduce the 1.44Gb of free space I had struggled to find down to 0.99Gb - Try a reboot.
As before, following the reboot I get "Failure configuring windows updates. Reverting changes".
Exactly the same as when running from 'disk cleanup'
JohnBusiness Consultant (Owner)Commented:
You should be able to install Windows Experience, find Disk Cleanup, run it, then push the Clean Up System Files button, all Disk Cleanup to re-run, then select most all options to delete and say OK.

Once done, see how much space is left.

Get Tree Size Pro (Jam Software), install it and run it and see where the space is going.

You may need to add disk space.
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

peter_lawrieAuthor Commented:
I've done all that. The problem is that after 'disk cleanup' apparently deletes the 6.2Gb of windows updates it identified, a reboot gives 'failure configuring windows updates' and reverses it.
After a second (automatic) reboot, I'm back where I started with 'disk cleanup' indicating 6.2Gb can be removed. Apart from 400Mb taken up by logs which I have to remove with ccleaner.exe
I have been around this loop about a dozen times with slight variations. The cleanup-disk.ps1 script I tried did exactly the same as 'disk cleanup'.

The eventual solution will be installing a second 500Gb disk, copying the current D: drive to it as a new D: drive, and repartitioning the original 500Gb drive as C:
If I do this, are there any 'gotchas' with 2008r2? Is there a built in partitioning tool or do I need a third party tool? I would rather not lose the current system on the C: drive.

Finally, what brilliant mind in Microsoft made the default configuration for installing 2008r2 produce a C: drive which was too small to allow for updates? I have almost 350Gb spare on D:
JohnBusiness Consultant (Owner)Commented:
The problem is that after 'disk cleanup' apparently deletes the 6.2Gb of windows updates it identified, a reboot gives 'failure configuring windows updates' and reverses it.

Try running System File Checker (run as Admin) to see if that fixes the issue.
Also see if DISM is available - it may not be.

System File Checker:

Open cmd.exe with Run as Administrator and run SFC /SCANNOW.
Allow to complete, restart or, preferably, shut down the computer and then start up again.
Test to see if the problem has been corrected.


Open cmd.exe with Run as Administrator.
DISM.exe /Online /Cleanup-Image /Scanhealth (takes 15 - 20 minutes).
DISM.exe /Online /Cleanup-Image /Restorehealth (takes 15 - 20 minutes).
Restart the computer and test.

How big is your operating system? Some vendors deliver them way too small.
peter_lawrieAuthor Commented:
First of all, I am attempting cleanup attempts using remote desktop as the server is 40 miles away. It's a busy dental practice, so I can only work on it in the evening. Obviously I cannot therefore shutdown and start up again. I have told them if I have to install another disk, I will need to visit and take the system for a few hours. Not best pleased about that, but I may be able to arrange time over the weekend.

dism.exe appears to be available. I tried /AnalyzeComponentStore and /StartComponentCleanup but they did not appear to work. I have a big cross against them in my notes but cannot remember exactly why! I also wrote /Scanhealth and /Restorehealth but did not try these.

I am aware of sfc /scannow - I have used it elsewhere. However, I did not try it with this system, so maybe I'll give it a go tonight.
peter_lawrieAuthor Commented:
I tried sfc /scannow and
DISM.exe /Online /Cleanup-Image /Scanhealth
Both ran to completion
/Restorehealth comes up with not found.

Then I tried disk cleanup again with same result
four or five minutes apparently removing 6.2gb then, after reboot, it reverses and I'm back where I started.

I told the practice manager that the easiest solution might be a new physical disk to be drive D: so I can remove the D: partition from the first disk and expand the C: partition.
JohnBusiness Consultant (Owner)Commented:
There appears to be a screw up in the operating system, so expanding the hard drive space should allow you to proceed without reinstalling the operating system.
David Johnson, CD, MVPOwnerCommented:
do your updates and reboots a few at a time. only when complete run the disk cleanup
peter_lawrieAuthor Commented:
tried that
JohnBusiness Consultant (Owner)Commented:
You need to provide more space, which probably means rebuilding the server.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
peter_lawrieAuthor Commented:
I blame Microsoft for inadequate default system drive size on installation.
However that is water under the bridge. It does appear that server 2012 has the tools to clean up winsxs. Supposedly this has been made available to server 2008r2, but it does not work!
I note that windows 7 does appear to maintain winsxs correctly.
Thanks for the suggestions, but it looks as if I will have to add a new drive in order to move D: so that I can expand C:
JohnBusiness Consultant (Owner)Commented:
You are very welcome and I was happy to help. Winsxs cleanup is the province of Windows 8.1 and beyond and Server 2012 and beyond. Windows 7 and Server 2008 cleanup does not work well enough.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.