It seems to be an inevitable part of life, reformatting your PC on a semi-regular basis.
Hardly inevitable -- It's been years since I last did it on any of my own computers.
#1 tip: don't install each random piece of crap you come across. If I need to check out some programs for a one-time thing, or if I'm just checking out a bunch of freeware apps, I never install them in my actual OS, but always in a vmware sandbox.
It is trivial to roll back to the latest snapshot before installation in vmware, and leaves absolutely no gunk behind. Only the 'good' applications which I use regularly are allowed outside my sandbox and actually get installed in my real XP install. amazing how much more stable, fast & clean that keeps your windows install.
The last time I reformatted was probably 3 years ago, when I upgraded to my current hard drive.
But I do keep a master DVD-R around with all the installers of every single program, driver and codec I use on any of my computers. Worst case, I have *everything* at hand.
I just keep a folder on my HD where I copy all that stuff to after installing it, organized by type (OS, internet, tools, drivers, codec, etc.), and periodically burn a DVD of it. when updating a piece of software, I'll also make sure to write the new installer to the master folder.