Hi
I was trying to format my computer because it's keep on restarting after few minutes from starting time
So basically you had this problem before formatting:
Random restart are happen usually because of a bad component, power supply problems, or over heating.
Have you removed dust from cpu fan ? If not you might want to clean it up.
If you can get into the bios you can check your cpu temps from there.
I would try a working power supply and run a check disk on your hard drive.
I had this kind of problem with a faulty hard drive controller on MB, it had to be changed (since you computer is aging)
If you can get you BSOD code it would give us a good idea on the problem.
Props!