Computer randomly shutting off during use

Computer is randomly shutting off when in use. I will be typing on word and it shuts off. I turn it back on and listen to music a little later it shuts off again. Turn it back on and leave it run for a while come back to it and move the mouse and it shuts off again. I have sleep and hibernate mode shut off this PC also this PC is keep on for days.

When it shuts off the screen shuts of and tower shuts off and power button blinks blue.
Thought it was in sleep or hibernate mood so move the mouse = nothing, hit enter on the keyboard = nothing, Try pushing the power button = nothing. Have to turn off the power bar to restart the computer. Then on boot up it says windows did not shut down properly.
I manage to scan the computer for virus none showed up on Bitdefender.
I went into bios and fans are work and CPU temp is at 37C which is normal.

The PC is an Emachine about 4 years old with MS-7207 motherboard and AMD Sempron 3000+ processor with Vista SP2 on it.

I dont know what could be the problem with it any help suggest or idea would be great :)
 
Hello, welcome to techspot. The first thing that comes to mind is the powersupply. E machines are known for having bad power supplys andi have experenced it.
 
I had a problem like this on a laptop I had, the problem was with the ram being faulty and once I changed it the problem went away
 
Thank you. I tried a new ram it still shut off. Tried and new power supply with the same watts it still shut off. Now it will not boot. I change the motherboard and CPU now it works. Either the motherboard or CPU went on it but now its all good thanks though for your suggestions :)
 
Back