Saturday, April 12, 2014

Washing Windows, Taking out the Trash

Doing a little housecleaning on Antique Laptop the other day.  Ran WinDirStat, a cute program that shows you where all your hard disk space has gone.  Lists all the directories in order of size and draws a neat little map of the disk, with each directory in a different color.  WinDirStat is on the web, Google can find it. 
   Anyhow, WinDirStat showed this big plump directory Windows/SoftwareDistribution.  It was plump, nearly 500 Mb.  Question, can I zap it and have my XP system survive the event?  Google drew a lot of hits on this one, ranging from don't touch it, your system will melt, to blow it away, it's worthless.  Sorting thru the answers it turns out that Windows Update is busily finding and downloading patches behind your back.  The patches come over the net in a compressed form.  Windows update decompresses the patch, applies it, and leaves the compressed version and some stuff needed if you ever want to back the patch out, in Software Distribution.  Lets be real here, nobody ever backs out a patch, unless it is killing their system.  Assuming your system is working well, you don't need the stuff in SoftwareDistribution. 
   So how do you get rid of it?  It's a little more complicated than just deleting it from Explorer.  Windows Update is a "service" a privileged piece of code that is always in RAM, and gets control of your machine when ever it likes, for as long as it likes.   Windows Update puts some kind of unbreakable protection on SoftwareDistribution so you cannot zap it in the ordinary way. How to cope?
Open a DOS window.  You do this from the start menu, hit the run box and type in "cmd".  For those of you who never had the pleasure of running DOS, it can be a little awkward.  The mouse doesn't work in DOS. Your first job is to navigate to the c:/windows directory using the CHDIR (CD for short) command. 
Do CD .. until you reach the c: root directory. 
Do CD windows and you should be there.
Do NET STOP wuauserv   to turn off windows update and unprotect the SoftwareDistribution directory.
Do RENAME (Ren for short) softwaredistribution  anynameyoulike (I used softtrash) .
Do NET START wuauserv to turn windows update back on. 

Exit DOS and check your system to make sure it still works.  Run a program or two.  Visit a website.  Then reboot to be sure that still works.   When you are satisfied, go back and zap the old softwaredistribution and recover quite a chuck of disk. You will notice that Windows Update has created a new, and smaller SoftwareDistribution  all by itself. The RENAME trick is a way to let you back out.  If something should go wrong, you can put things pack the way they were. 
   Not only does this trick recover a lotta disk, it speeds things up.  Antique Laptop boots faster, fast enogh to notice.  I think Windows Update had been wasting time riffling thru 500 Mb of patches going back to the year 2000.
   I did this trick on XP, but a lot of the net rumor I read tells me Vista, 7, and 8  has the same problem only worse.  There is a tool, DISM, in the newer Windows to deal with the ever growing Windows trash directories.  I'm still on XP so I cannot tell you much about that.

No comments: