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

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 :-)