When used on a dual-boot computer, the following steps will restore the Windows boot loader and then remove the Ubuntu partitions。
1. Insert your Windows installation CD and boot from it. When the initial installation choices menu appears, hit r to get to the Recovery Console. Select your Windows partition when prompted, and enter the Administrator password when prompted (if you didn’t set an administrator password, just hit Enter ).
2. Type the following commands, the last of which will reboot your computer:
C:\> bootcfg /rebuild
3. You should now be able to boot into Windows when the computer is rebooted, but to delete the Ubuntu partitions and enlarge the Windows partition you’ll need to boot from your Ubuntu CD and use Gparted. Select the Try Ubuntu option from the Ubuntu installer boot menu and once Ubuntu is up and running, click System ! Administration ! Partition Editor.
4. Look for your Ubuntu swap partition in the list—it will probably be identified as linux-swap. Right-click it and then select Swapoff from the menu that appears.
5. Select the main Ubuntu partition (it will be identified as ext3 in the list), right-click and select Delete. Repeat with the linux-swap partition. Note that the two partitions might be in an extended partition. You may need to select this too and then select Delete.
6. Right-click the NTFS (Windows) partition and select Resize/Move.Then, in the dialog that appears, click and drag the right-edge of the graphical representation of the partition until it fills the disk. Click the Resize/Move button. Then click the Apply button in the main Gparted window. Note that if you see an error during NTFS resizing, it’s likely you didn’t shutdown Windows properly the lastBtime you used it. Reboot into Windows and run a chkdsk. Then repeat this step.
7. There’s one last thing to take care of—getting rid of the Windows boot menu we introduced when restoring theWindows boot loader. Using My Computer, browse to the root of C:\ and right-click boot.ini (ensure you have chosen to show invisible files in Tools ! Options). Click Properties and remove the check from the Read Only box. Then open :\boot.ini in Notepad, and change the timeout=30 line to read timeout=0. Save the file and reboot to test.