Hi all I am sure your power supply is not supporting your system thats why It is restarting.Firstly change your power supply.After that your problem will be solved. ok
Here is few more tips dude: 1- Check your power supply, electricity related issues and maybe the AC cable.. 2- Open your pc case, remove the rams.. use a tissue to clean them and reinsert them once again Hope it's going to work after that, as i don't really think it's a software issue