Flattening the world

Yesterday, I finally decided to bite the bullet and flatten my dev machine.  I got this machine in 2003, and obviously installed XP on it, I've been self-hosting Vista on it since some time around April of this year, upgrading just about every week.

The thing about upgrades of interim builds of the OS is that sometimes things don't quite work right after the upgrade.  Sometimes things get ACL'ed incorrectly, sometimes registry settings get migrated that should be reset, sometimes stuff gets put in the wrong place.  These problems get noticed and fixed after they occur, but they sometimes leave little bits and pieces behind.

One great example hit about 2 months ago - I suddenly lost my ability to view JPGs in the sidebar.  They worked just fine everywhere else (I thought), but not from the sidebar.  Digging into the sidebar code, I realized that the sidebar was just calling ShellExecuteEx on the JPG file, which led me to realize that I couldn't launch JPGs from the command interpreter either.  Digging into the ShellExecuteEx code, I realized that the file association handler for JPG files wasn't working correctly - it was loading a DLL, but the object hosted in that DLL didn't implement some class.

I looked at the COM registration in regedit, and it looked ok, so I asked for the shell team for help.  They asked me to get a regmon trace, and using the trace, they figured out what had happened.  It turns out that the handler for some COM class was moved from one DLL to another DLL back in July.  No big deal, the COM registry had been fixed up so it wasn't a problem.  The problem for me was that an upgrade back in June had accidentally virtualized the COM registration for the object that contained this class.  When the registry was updated, the virtualized registry wasn't updated (because the system didn't know about it).

Our customers would never see this bug, neither would any user performing a clean upgrade, it only showed up because I upgraded from build-to-build - if I'd clean installed it would never have hit me.


So yesterday, I decided that it was time to flatten my dev machine[1].  I've had enough "wierd" things happen (strange Outlook behaviors, etc) that I decided it would just be safer to reset the world.

It's weird, I've not reinstalled an OS on my of my machines in a VERY long time (at least a couple of years now), it felt strange.

But I figured it had to be done.  First thing I did was to uninstall all the software on my machine that I didn't think I used day-to-day (I had a LOT of junk that had built up over time).  I wrote down all the stuff I knew I would need, and made sure that I had copies of the software to reinstall.  I next used the Windows Easy Transfer (migration wizard) tool to back up my user settings, and reinstalled the OS.  So far so good.  I next used the migration wizard to put my stuff back, and reinstalled all my apps.


The cool thing is that it worked just about perfectly.  I now have a newly scrubbed clean machine, all my data's back (and even then, my old data's not been lost - the upgrade copied all the data that was going to be reset to the Windows.old directory on my hard disk).  I'm still going through confirming that I didn't leave any data behind that I cared about, currently it looks perfect. 



[1] Flatten vs. Pave over.  To flatten a machine is to reinstall the OS clean, to pave a machine is to reformat the hard disk.  You flatten a machine to resolve OS corruptions, you pave over a machine to recover from a virus infection[2].

[2] KC Lemson is getting to me 🙂


Edit: Fixed stupid typo.

Comments (16)

  1. Anonymous says:

    This whole idea of resetting/rebooting is so weird. it creeps into other things that you do and you re-do the same things losing precious time. Microsoft must come a long way trying to solve this problen already but still lot of us have caught that habit and re-do/re-set things.

  2. As I mentioned – the only other time I’ve EVER done this was back in 2004 when my laptop picked up a virus – before that, I think the last time was back in 2000ish (back when I had Win9x on my machines).

  3. Anonymous says:

    That’s a familiar story – personally, I reinstall the OS every 8 months or so, just to get rid of the general cruft that builds up. Highly recommended.

    Some folks actually throw away their PC and buy a new one, rather than go through this process. They perceive the software degradation as a physical degradation. Hopefully those PCs get recycled.

  4. Interesting – I know people who love to reinstall their machines (my wife’s one of them). Personally I don’t – I’ve never had enough stuff build up that it actually mattered.

    This was a very special case caused by many, many upgrades of an in-development operating system.  It’s interesting – I’ve already noticed that Newsgator Inbox is much happier after the reinstall.

  5. Sven says:

    My steps are:

    1) Install a new system.

    2) Change the registry values for AppData, Local AppData, My xxx from C:… to D:… .

    3) Install apps/tools.

    4) Make an image (True Image, Ghost, …).

    5) Take a note of apps and settings I have forgotten to install or to change.

    6) Restore the image from time to time and redo these things.

    7) Goto 4

    So you always have a "clean" system.

  6. Mike Dimmick says:

    My new notebook seems significantly quicker at booting than my old desktop, which is actually quite surprising since there’s more hardware in this box, hence a greater number of drivers. The hard disks are actually fairly comparable: a 120GB, 8MB cache, 7200rpm Hitachi DeskStar (ATA-100) in the old box, a 100GB 8MB cache 7200rpm Hitachi TravelStar 7K100 (SATA-150) in the laptop. While the laptop is a Core 2 Duo 2GHz and the desktop a 2.8GHz P4 (on 533MHz bus), the extra processing power shouldn’t make much difference to boot time, which is most likely to be I/O bound. The old box only has 512MB of RAM, while the laptop has 2GB, which might make a difference to caching, but I wouldn’t expect that much code and data to be referenced at boot time for caching effects to become particularly relevant.

    The Windows XP installation on the desktop is from birth, about 3.5 years old, I think. I do recall it being quicker when new.

    My pet theory, for what it’s worth, is that, over time, the registry files on disk become internally discontiguous – that keys and values adjacent to one another in the logical view are scattered throughout the files. This occurs as keys and values are added, removed and changed over the life of the system. What starts out as a sequential access to read a number of keys and values at the birth of a system, becomes more and more random as the data is distributed. Unfortunately I have no evidence to support this idea. If it *is* the case, you might be able to get a less fragmented registry by backing up System State in Windows Backup, then restoring it.

  7. Mike Dunn says:

    I’ve had b2 on my laptop (preceded by RC1 and by b2, yes I went back to b2), and some of the ACLs are munged and it’s annoying to have to elevate just to move certain files or empty the recycle bin. I’m gonna format/reinstall once the RTM build shows up on MSDN.  It’ll be worth taking a day to rebuild the machine just to get rid of the annoyances.

  8. Anonymous says:

    > The thing about upgrades of interim builds of the OS is that

    > sometimes things don’t quite work right after the upgrade.

    I’ve read lots of reports, outside of Microsoft, none of them written by me, saying that this is the thing about upgrade installs of released versions.  Lots and lots of people recommend doing clean installs either into a new partition or after paving an (the) existing partition, and just temporarily inserting their old installation CD to prove ownership of the previous version.  Lots and lots of people have good reasons to make that recommendation.

    > These problems get noticed and fixed after they occur, but

    > they sometimes leave little bits and pieces behind.

    That seems to be about 2/3 true.  Noticed after they occur, and sometimes they leave little bits and pieces behind.

  9. Norman, you’re right.  It may be controversial, but the safest form of installation is a clean install.

    Vista actually does a MUCH better job of upgrading than previous versions of the OS because upgrading on Vista is done by sucking out all the upgradable stuff from your old OS, laying down a new OS, then spitting back the saved stuff on the new image.  As a result, it’s harder for messed up configs on an old build to mess up the new build.

    But a clean install is always pretty much guaranteed to be pristine.

    And as far as I can tell, every one of the problems I had while upgrading was eventually fixed before RTM – none of the issues I saw over the 8 months of upgrading week-to-week would have ever been seen by a customer.

  10. Anonymous says:

    I’d like to know by what criteria "Windows Easy Transfer" choose to backup files?

    You know, software nowadays dump files/settings everywhere. php.ini can be in it’s directory, or windows directory. Some uses .ini files, and others uses .dat/.sav files or even other proprietary formats. And most softwares have their settings in registry.

    But if it’ll backup everything, maybe it’d also carrie unused rubbish files…

    Could I simply trust that everything would be safe?

  11. Cheong, I don’t know the answer, sorry.  It appears to have heuristics that pick up some non MS applications though, my guess is that there’s a way of plugging into it, because several 3rd party apps were included.

  12. Anonymous says:


    You’re right that registry hives can become fragmented over time. I  always install PageDefrag (http://www.microsoft.com/technet/sysinternals/FileAndDisk/PageDefrag.mspx) and have it run on boot up to keep my registry and pagefile contiguous.

  13. Anonymous says:

    I’ve just had both my workstations replaced. In the past, the only times when my workstations (or their parts) were replaced is when the hard disks passed away. This time, I had a chance to backup my data and list my software, and even got the old disks installed on the new PCs for a while.

    Turns out it is much harder this way… When your PC just dies, you start to work with what you’ve got. But when the old one is just retiring, you’ll alway be in doubt about what you’ve left behind. And this time, it’s totaly up to you!

    Took me two days to setup my work environment. Don’t think it would have taken a minute longer if my old workstations would have just disappeared.

  14. Anonymous says:

    Something in Vista RC1 broke my way of doing things:

    1. Attach external HDD to laptop

    2. Use WinHex to do 1:1 copy of the intenal laptop HDD (this doesn’t work after RC1, access denied)

    3. Install Vista on clean laptop hdd

    4. mount the old system volume from the external HDD and use it as backup and source for needed files and configurations.

    Somehow I managed to go around the access denied issue and install RC2 but forgot how. I have an adapter to install the laptop hdd to desktop computer through USB if all else fails.

  15. Anonymous says:

    I fell in love with the Vista setup and how it took care of everything. And that was just the RC. I’m sure the RTM would be even better. Hopefully a lot of ppl get to share my experience and enjoy the new OS soon! Maybe, I can do some setup toons at http://sillygloop.spaces.live.com 🙂

  16. Anonymous says:

    If I had but one legacy meaningful enough to leave on this world after I pass, I dearly hope that it is my footnote methodology.

Skip to main content