the only way you can do this, is to use a windows install disk
(windows xp I assume)
you will need a product key as well
see if your friend has an install cd (maybe one that came with it)
once you have the cd, all you have to do is put it in and start the computer
while its booting, watch for *press any key to boot from cd.....
then just run the windows setup, (format the hd to ntfs)
if you can't get a cd from him, then download an iso and use this program to get your key...
I'm pretty sure this is legal, as you already had the key...