Some virus programs write themselves to ram and when you shutdown your computer the ram dumps and writes whats in it to your HDD, when you restart the machine its common to restore the last window you had open, and the virus is retrieved from the HDD and the virus replicates sometimes to new locations.
Theres numerous routes you can take to eliminate these kind of threats sometimes involving quite some time to do but if you're considering a scratch reinstall anyway, heres in my opinion the best way to do it.
First get a HDD diagnostic disk for the brand HDD [WD, Maxtor, Seagate, Hitachi, whatever you have, make sure this diagnostic disk has the capability of doing whats acceptably called a Low Level Format [IE. LLF], or Disk Wipe, or Zero Fill, ETC, all different names for the tool, that writes usually zeros to the entire HDD, including the boot record[which can be a virus hiding place], which wipes out all previous data including virus's.
When you're ready to do the LLF its usually done with a floppy diagnostic disk, do not shutdown the computer normally, just pull the power cord from the machine, any virus resident in RAM will be wiped out, your RAM has to have power to maintain its data and there will be no time for it to write to the page file.[Drastic measures but no more harmful than a power outage]
Then put the floppy diagnostic disk in the floppy drive, power up the computer enter setup, by holding down the Delete key or F1 to enter setup, set the first boot device to the floppy drive, 2nd boot CDROM [for reinstalling XP after the LLF], 3rd boot HDD.[Save and exit setup and the machine will automatically boot with the floppy disk already in the drive]
When the machine boots the floppy diagnostic disk will run automatically, look for the zero fill, or disk wipe, or LLF option, then if it gives you options of the quick write, don't select that go with the full disk wipe, it effectively takes about 35min for each 20g, so if you have a huge HDD, do something else while the LLF is going on it will take a while to complete.[There is usually a progress bar to show you what its doing]
Afterwards install WinXP as you normally would, giving it the OK to do so WinXP installation will Partition and [High Level] Format the HDD and your virus will be gone.
Try to figure out how you got this thing so you don't get it again, hope this helps you out. Ryan
Edit; Sorry you can download your HDD diagnostic disk creator from the HDD manufacturers website, if you do not have a Floppy Drive you can download a bootable CD ISO image and create a bootable CD, but in my experience the Floppy works the best. Good Luck and if you have any problems feel free to PM me.