dude, try this.
-Make the CD drive, your primary boot device.
-Put your XP installer disc(I'm assuming your previous OS is XP).
-Boot the desktop using the disk
-When prompted to choose to install or repair, press "R".
-This will put up the recovery console screen, much like DOS.
-Enter your primary drive where your OS is located, default is C:
-repair your OS's boot sector by typing fixboot. Restart your computer and remove the CD from the tray. That should work
If that doesn't work, try this ( only, and if only there is no partition on the HDD)
Do the same steps above, but now type FixMBR
this should rewrite your OS's master boot record.
Again "DO THIS IF, AND ONLY IF THE HARD DRIVE HAS NO PARTITION"
Rewriting the master boot record will mess up your partitions and you will lose all data from the lost partition.