The Master Boot Record is what the BIOS uses to find an operating system for the computer to boot into.
For Windows XP
You will need to check your BIOS settings to make sure that your CD/DVD drive is the first boot option to let you boot from a CD/DVD.
Put your Windows XP CD into the CD/DVD drive and reboot. The computer will start to boot from the CD. The Recovery Console is the first Repair option you come to. Press R when the option appears. There is more information on accessing the Recovery Console Microsoft's How to Use the Recovery Console Scroll down to booting from the installation CD.
From the command prompt type the following:
FIXMBR C: FIXBOOT C: BOOTCFG /rebuild
When that is complete reboot your computer. It should boot normally.
For Windows Vista
You will need to check your BIOS settings to make sure that your CD/DVD drive is the first boot option to let you boot from a CD/DVD.
Vista has a different Master Boot configuration and the procedure is slightly different from the method used for Windows XP.
To repair the Vista Boot Configuration Data
Put the Windows Vista installation disc in the CD\DVD disc drive, and then reboot the computer.
From the command prompt, type the following:
Bootrec.exe /FixMbr
Bootrec.exe /FixBoot
Bootrec.exe /RebuildBcd
This command scans all disks for installations that are compatible with Windows Vista. Additionally, this option lets you select the installations that you want to add to the Boot Configuration Data store.
I found it necessary to type the commands in one at a time, press enter after each one. After the commands are done type exit, press enter and choose restart.