my dads windows machine is fried. it is turning off randomly. i opened it up and saw what i believed to be domed capacitors

I have another computer setup with out a hard drive all the parts are from the same era but its no an identical match can i take the hard drive out and put it in the spare computer and will it boot or allow me to re-register xp

the windows xp hard drive is an OEM install

thanks in advance