If it is a cooling issue, you need to check the heatsink & fan - check specifications of the heatsink/fan & make sure it is adequate for your CPU.
You should also put some thermal compound between the heatsink & the CPU, particularly if the heatsink has been removed at any point.
memtest86 is a DOS based program thats tests your RAM. If you are certain its not a cooling problem then it would be wise to run this. If it is bad RAM, you should get the shutdown problem running it in a pure DOS enviroment because it uses far less memory than windows.
You can download memtest86 by following this link :