Well, one way, is to boot from a clean, primary boot disk, with the infected disk(s) attached, and then clean up those disks.
With a modern system that allows you to boot from an external USB or eSata drive, it's a simple thing to attach such a drive, boot to your computer's BIOS, set the machine's BOOT priority order to boot first to the USB or eSata drive of your choice, save your settings and then boot to the external drive.
You can now safely clean those compromised disks. Once you are done, just reverse these steps. Shutdown the computer; remove the external drive; boot the the BIOS and set the BOOT priority back the way it was; reboot the original disk.
Of course, you have to get a bootable external hard drive to make this work, but external hard drives have become very cheap these days, under a hundred dollars for a 500GB drive if you look round.
Then you have to install the OS on it. I will assume you still have the copy of XP or Vista you system came with, so you just set the computer to boot to your USB or eSata drive as explained above, and then to the CD/DVD drive and install to the empty drive when the OS gives you the option to do so.
You can also put a brand new hard disk in the computer using the same instructions, install the OS to that drive, and then install the original drive as a secondary drive by adding it to another SATA port on the motherboard, using the cable which came with the new hard drive, and a spare Power Supply cable.
The procedure for cleaning the infected drive is otherwise the same.Hey, you just saved some dough! Happy now?