How to Reinstall Ubuntu Grub Bootloader after windows wipes it out

1. Boot with the liveCD
2. Open Terminal and type:

sudo grub
grub>
grub> find /boot/grub/stage1
(hd0,5)  {YOU WILL USE THIS FOR NEXT COMMAND}
grub> root (hd0,5)
grub> setup (hd0)
grub> quit

For Ubuntu 9.10 with grub 2, see this page:
http://thanhsiang.org/faqing/node/146

Best solution to this problem!

There are plenty of solutions on the internet to this problem but most assume grub is on hd0,0 - this is not always the case and this is where this solution works the best! Many thanks :-)

how to solve

GRUB4DOS 0.4.4 2009-4-20,memory 639k/ 1788m Menu End 0×434CE
[Minimal BASH -like line is supported. For the first word, TAB list possible
command completions.Anywhere else TAB lists the possible completion of a
device/filename.ESC at any time exists.]

GRUB>root (hd0,1)
FileSystem type is ntfs,partition type 0×07

GRUB>setup (hd0)
Error 15 file not found

GRUB>setup (hd0,1)
Error 15 file not found

please help me immediately....................

your's obediently

A.Nijamudeen